From: Martin Mares Date: Thu, 6 Feb 2014 09:52:26 +0000 (+0100) Subject: Opt: Avoid fixed constants, use OPT_POSITIONAL_TAIL X-Git-Tag: v6.0~68 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=a5c9e58dc8cb059f9b684b85d09a2ff1a1394b31;p=libucw.git Opt: Avoid fixed constants, use OPT_POSITIONAL_TAIL --- diff --git a/ucw/opt.c b/ucw/opt.c index 5598a13b..7eadbd64 100644 --- a/ucw/opt.c +++ b/ucw/opt.c @@ -363,8 +363,8 @@ int opt_parse(const struct opt_section * options, char ** argv) { opt_count_items(oc, options); oc->opts = alloca(sizeof(*oc->opts) * oc->opt_count); - oc->shortopt = alloca(sizeof(*oc->shortopt) * (oc->positional_max + 257)); - memset(oc->shortopt, 0, sizeof(*oc->shortopt) * (oc->positional_max + 257)); + oc->shortopt = alloca(sizeof(*oc->shortopt) * (oc->positional_max + OPT_POSITIONAL_TAIL + 1)); + memset(oc->shortopt, 0, sizeof(*oc->shortopt) * (oc->positional_max + OPT_POSITIONAL_TAIL + 1)); oc->hooks = alloca(sizeof (*oc->hooks) * oc->hook_count); oc->opt_count = 0;