X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fcast%2F_info;h=29128b8d5cf7cff915b07fa01783c2c44727073f;hp=d66e7091b42ccfc45a1d7c86c12b114f6b4b4d3a;hb=a8722345053b7cd860499aa31fd6bb414c120cc8;hpb=dd0404162fd548cd1774943335560a2e58373914 diff --git a/ccan/cast/_info b/ccan/cast/_info index d66e7091..29128b8d 100644 --- a/ccan/cast/_info +++ b/ccan/cast/_info @@ -1,5 +1,6 @@ -#include #include "config.h" +#include +#include /** * cast - routines for safer casting. @@ -19,10 +20,11 @@ * 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 * #include * #include + * #include * * // Find char @orig in @str, if @repl, replace them. Return number. * static size_t find_chars(char *str, char orig, char repl) @@ -52,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",