X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fcharset%2F_info;fp=ccan%2Fcharset%2F_info;h=919acda618641b57dd73e4901bb3b7c9e1dab91b;hp=aa0193d7e4b83de5f1c37dba73969be65194b6a2;hb=cbb99113cd42e631934221dcf27093906e19a463;hpb=e22289e92326afa6fa28e39a6db5eb2111a49817 diff --git a/ccan/charset/_info b/ccan/charset/_info index aa0193d7..919acda6 100644 --- a/ccan/charset/_info +++ b/ccan/charset/_info @@ -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; * } *