X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fopt%2Fhelpers.c;h=25929bd5bf705f6681a1c7303288a58a16d4453c;hb=dded32f2b03fca526271e35671fa36d299880429;hp=17d56e0201dc66d7810b26f1cd40a1e5e702f0a7;hpb=ec822c6589eeaeb3f45c12876db2016be5808688;p=ccan diff --git a/ccan/opt/helpers.c b/ccan/opt/helpers.c index 17d56e02..25929bd5 100644 --- a/ccan/opt/helpers.c +++ b/ccan/opt/helpers.c @@ -1,5 +1,6 @@ /* Licensed under GPLv3+ - see LICENSE file for details */ #include +#include #include #include #include @@ -52,7 +53,7 @@ char *opt_set_invbool_arg(const char *arg, bool *b) /* Set a char *. */ char *opt_set_charp(const char *arg, char **p) { - *p = (char *)arg; + *p = cast_const(char *, arg); return NULL; } @@ -133,7 +134,7 @@ char *opt_usage_and_exit(const char *extra) char *usage = opt_usage(opt_argv0, extra); printf("%s", usage); /* Don't have valgrind complain! */ - free(usage); + opt_alloc.free(usage); opt_free_table(); exit(0); }