]> git.ozlabs.org Git - ccan/blobdiff - ccan/cast/_info
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / cast / _info
index f5cd37fc337bf42159f3f4fa66fc846031eb6d20..29128b8d5cf7cff915b07fa01783c2c44727073f 100644 (file)
  * License: LGPL (v2.1 or any later version)
  *
  * Example:
- *     // Given "test" contains "3 t's in 'test string'
+ *     // Given "test" output contains "3 t's in 'test string'"
  *     #include <ccan/cast/cast.h>
  *     #include <stdint.h>
  *     #include <stdio.h>
+ *     #include <stdlib.h>
  *
  *     // Find char @orig in @str, if @repl, replace them.  Return number.
  *     static size_t find_chars(char *str, char orig, char repl)
@@ -53,6 +54,9 @@
  *     {
  *             uint64_t hash;
  *
+ *             if (argc != 2) {
+ *                     fprintf(stderr, "Needs argument\n"); exit(1);
+ *             }
  *             // find_chars wants a non-const string, but doesn't
  *             // need it if repl == 0.
  *             printf("%zu %c's in 'test string'\n",