From a5c9e58dc8cb059f9b684b85d09a2ff1a1394b31 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 6 Feb 2014 10:52:26 +0100 Subject: [PATCH] Opt: Avoid fixed constants, use OPT_POSITIONAL_TAIL --- ucw/opt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.5