work on docs
[pspp] / src / libpspp / argv-parser.c
index c72c250394864091bb8bcd3458cb8bfae413c2c1..48c89cd6d44e93f6bb69f99a41bd6a98024c54af 100644 (file)
@@ -43,7 +43,7 @@ struct argv_parser
 struct argv_parser *
 argv_parser_create (void)
 {
-  struct argv_parser *ap = xzalloc (sizeof *ap);
+  struct argv_parser *ap = XZALLOC (struct argv_parser);
   return ap;
 }
 
@@ -162,7 +162,7 @@ argv_parser_run (struct argv_parser *ap, int argc, char **argv)
           retval = false;
           break;
         }
-      else if (c >= LONGOPT_VAL_BASE && c < LONGOPT_VAL_BASE + n_longopts)
+      else if (c >= LONGOPT_VAL_BASE && c < LONGOPT_VAL_BASE + n_longopts + 1)
         {
           struct argv_option_plus *aop = &ap->options[c - LONGOPT_VAL_BASE];
           aop->cb (aop->base.id, aop->aux);