X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fopt%2Fusage.c;h=f321ed2949a8bfb7cd5cdbce5955780dba1cd233;hp=60e1586861adc0981a5bf0eaf00bc63bcff450a4;hb=bbdf3ef3c2c14e515388c6146fd00557cee905a1;hpb=5a02610cb444952a1c0fa820f579a4e535f617ec diff --git a/ccan/opt/usage.c b/ccan/opt/usage.c index 60e15868..f321ed29 100644 --- a/ccan/opt/usage.c +++ b/ccan/opt/usage.c @@ -1,3 +1,4 @@ +/* Licensed under GPLv3+ - see LICENSE file for details */ #include #include #include @@ -32,8 +33,8 @@ char *opt_usage(const char *argv0, const char *extra) extra = ""; for (i = 0; i < opt_count; i++) { if (opt_table[i].cb == (void *)opt_usage_and_exit - && opt_table[i].arg) { - extra = opt_table[i].arg; + && opt_table[i].u.carg) { + extra = opt_table[i].u.carg; break; } } @@ -100,7 +101,7 @@ char *opt_usage(const char *argv0, const char *extra) if (opt_table[i].show) { char buf[OPT_SHOW_LEN + sizeof("...")]; strcpy(buf + OPT_SHOW_LEN, "..."); - opt_table[i].show(buf, opt_table[i].arg); + opt_table[i].show(buf, opt_table[i].u.arg); len += sprintf(p + len, " (default: %s)", buf); } p += len;