summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/getopt.c
diff options
context:
space:
mode:
authorJoseph Koshy <jkoshy@FreeBSD.org>2001-08-26 03:36:04 +0000
committerJoseph Koshy <jkoshy@FreeBSD.org>2001-08-26 03:36:04 +0000
commitaff50c770d09ea60d53a27c39fe8a3d9c8a564da (patch)
tree3082cab6684edc2089c9b66c9076b45069fc5ce1 /lib/libc/stdlib/getopt.c
parentf83f2ff36c78f445295618a16ed69f6d38441d87 (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib/getopt.c')
-rw-r--r--lib/libc/stdlib/getopt.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libc/stdlib/getopt.c b/lib/libc/stdlib/getopt.c
index 17059a8ea55f..873d443554f3 100644
--- a/lib/libc/stdlib/getopt.c
+++ b/lib/libc/stdlib/getopt.c
@@ -65,7 +65,6 @@ getopt(nargc, nargv, ostr)
extern char *__progname;
static char *place = EMSG; /* option letter processing */
char *oli; /* option letter list index */
- int ret;
if (optreset || !*place) { /* update scanning pointer */
optreset = 0;
@@ -105,14 +104,12 @@ getopt(nargc, nargv, ostr)
else if (nargc <= ++optind) { /* no arg */
place = EMSG;
if (*ostr == ':')
- ret = BADARG;
- else
- ret = BADCH;
+ return (BADARG);
if (opterr)
(void)fprintf(stderr,
"%s: option requires an argument -- %c\n",
__progname, optopt);
- return (ret);
+ return (BADCH);
}
else /* white space */
optarg = nargv[optind];