From cbb99113cd42e631934221dcf27093906e19a463 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 19 Aug 2014 02:33:03 +0930 Subject: [PATCH] charset: make example use tal/grab_file instead of grab_file. Signed-off-by: Rusty Russell --- ccan/charset/_info | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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; * } * -- 2.39.2