X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcast%2F_info;h=d66e7091b42ccfc45a1d7c86c12b114f6b4b4d3a;hb=HEAD;hp=2dd9b208488bf5622826e3a4310062e346b489dc;hpb=118ace351b789dfaca8866f84a8cd4b924941268;p=ccan diff --git a/ccan/cast/_info b/ccan/cast/_info index 2dd9b208..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. @@ -16,13 +17,14 @@ * * Author: Jan Engelhardt * Maintainer: Rusty Russell - * License: LGPL + * 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",