]> mj.ucw.cz Git - libucw.git/commitdiff
Opt: Avoid fixed constants, use OPT_POSITIONAL_TAIL
authorMartin Mares <mj@ucw.cz>
Thu, 6 Feb 2014 09:52:26 +0000 (10:52 +0100)
committerMartin Mares <mj@ucw.cz>
Thu, 6 Feb 2014 09:52:26 +0000 (10:52 +0100)
ucw/opt.c

index 5598a13b340bdbff9402495d8c38781feebfefa6..7eadbd64c4efe54c8efa5f550760d0f8e18d3449 100644 (file)
--- 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;