(arg_match_short): backup optind when there's a missing argument so
that the error can point at the flag and not the non-existant argument git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8026 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -461,8 +461,10 @@ arg_match_short (struct getargs *args, size_t num_args,
|
||||
++*optind;
|
||||
optarg = rargv[*optind];
|
||||
}
|
||||
if(optarg == NULL)
|
||||
if(optarg == NULL) {
|
||||
--*optind;
|
||||
return ARG_ERR_NO_ARG;
|
||||
}
|
||||
if(args[k].type == arg_integer) {
|
||||
int tmp;
|
||||
if(sscanf(optarg, "%d", &tmp) != 1)
|
||||
|
Reference in New Issue
Block a user