summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1996-11-24 23:18:44 +0000
committermillert <millert@openbsd.org>1996-11-24 23:18:44 +0000
commit522c9f29f73433e1e1d78ea7f7860f0e6e1a23aa (patch)
treecd344ebe1a4b58ad36b2d17867c94e39a74e5063
parentManpage anyone? (diff)
downloadwireguard-openbsd-522c9f29f73433e1e1d78ea7f7860f0e6e1a23aa.tar.xz
wireguard-openbsd-522c9f29f73433e1e1d78ea7f7860f0e6e1a23aa.zip
Fix truncation of options list in getopts builtin.
Noticed by Matthieu Herrb <Mathieu.Herrb@mipnet.fr>
-rw-r--r--bin/sh/options.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/sh/options.c b/bin/sh/options.c
index 7c7f1c94606..1d54c05451b 100644
--- a/bin/sh/options.c
+++ b/bin/sh/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.5 1996/11/24 17:43:03 millert Exp $ */
+/* $OpenBSD: options.c,v 1.6 1996/11/24 23:18:44 millert Exp $ */
/* $NetBSD: options.c,v 1.19 1996/11/06 01:17:11 christos Exp $ */
/*-
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 5/4/95";
#else
-static char rcsid[] = "$OpenBSD: options.c,v 1.5 1996/11/24 17:43:03 millert Exp $";
+static char rcsid[] = "$OpenBSD: options.c,v 1.6 1996/11/24 23:18:44 millert Exp $";
#endif
#endif /* not lint */
@@ -423,7 +423,7 @@ getopts(optstr, optvar, optfirst, optnext, optptr)
p = **optnext;
if (p == NULL || *p != '-' || *++p == '\0') {
atend:
- **optnext = NULL;
+ *optnext = NULL;
ind = *optnext - optfirst + 1;
done = 1;
goto out;