Skip invalid commandline args instead of aborting

This commit is contained in:
Chris Young 2015-11-24 23:55:40 +00:00
parent e27525123b
commit 4ad94124a6

View File

@ -734,8 +734,10 @@ nsoption_commandline(int *pargc, char **argv, struct nsoption_s *opts)
/* check we have an option */
/* option must start -- and be as long as the shortest option*/
if ((arglen < (2+5) ) || (arg[0] != '-') || (arg[1] != '-'))
break;
if ((arglen < (2+5) ) || (arg[0] != '-') || (arg[1] != '-')) {
idx++;
continue;
}
arg += 2; /* skip -- */