X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcharset%2F_info;h=919acda618641b57dd73e4901bb3b7c9e1dab91b;hb=15966998bbeaea92e4e1b1c9f067a4142f51f680;hp=e07d7040488cccfaf7e41a345ecc019843c0525e;hpb=095540b72965c5e673c498accdd73d43a2838b61;p=ccan diff --git a/ccan/charset/_info b/ccan/charset/_info index e07d7040..919acda6 100644 --- a/ccan/charset/_info +++ b/ccan/charset/_info @@ -1,6 +1,6 @@ +#include "config.h" #include #include -#include "config.h" /** * charset - character set conversion and validation routines @@ -14,8 +14,8 @@ * #include * #include * #include - * #include - * #include + * #include + * #include * * static void print_json_string(const char *s); * static bool parse_hex16(const char **sp, unsigned int *out); @@ -24,23 +24,22 @@ * int main(void) * { * char *input; - * size_t length; * - * input = grab_file(NULL, NULL, &length); + * input = grab_file(NULL, NULL); * if (!input) * err(1, "Error reading input"); - * if (!utf8_validate(input, length)) { + * if (!utf8_validate(input, tal_count(input)-1)) { * fprintf(stderr, "Input contains invalid UTF-8\n"); * return 1; * } - * if (strlen(input) != length) { + * if (strlen(input) != tal_count(input)-1) { * fprintf(stderr, "Input contains null characters\n"); * return 1; * } * * print_json_string(input); * - * talloc_free(input); + * tal_free(input); * return 0; * } *