Fixed bug in command line parser
[pspp] / src / libpspp / argv-parser.c
index c72c250394864091bb8bcd3458cb8bfae413c2c1..97ec02834a43d02baf4598c9b5c05d8832960c8b 100644 (file)
@@ -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);