(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:
Assar Westerlund
2000-03-09 07:49:35 +00:00
parent 2a18fdf39e
commit 41c126a7ce

View File

@@ -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)