X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcharset%2F_info;h=919acda618641b57dd73e4901bb3b7c9e1dab91b;hb=580457bd3e4af60d5367412589d2aa1bb0289eed;hp=246ca0738ad5c851554d743e5773a5da8446bc59;hpb=06c4af3163e2bd99999a93a478d1308ea39c5a79;p=ccan diff --git a/ccan/charset/_info b/ccan/charset/_info index 246ca073..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; * } * @@ -151,8 +150,9 @@ * return true; * } * - * Author: Joey Adams + * Author: Joey Adams * License: MIT + * Version: 0.3 */ int main(int argc, char *argv[]) {