summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkn <kn@openbsd.org>2019-03-01 12:47:36 +0000
committerkn <kn@openbsd.org>2019-03-01 12:47:36 +0000
commitc1e58e1aca6a40a5daaf32733def396636c54860 (patch)
tree55feca5d9e5d41f991d0cd29ab12770da462a650
parentWrap .Sh/.SH sections and .Ss/.SS subsections in HTML <section> elements (diff)
downloadwireguard-openbsd-c1e58e1aca6a40a5daaf32733def396636c54860.tar.xz
wireguard-openbsd-c1e58e1aca6a40a5daaf32733def396636c54860.zip
Fix previous extra arguments commit
I blatantly missed the argc/argv adjustments after getopt(3), resulting in valid commands like `vmctl create a -s 1G' to fail. Noticed by ajacoutot the hard way. OK ajacoutot jca
-rw-r--r--usr.sbin/vmctl/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/vmctl/main.c b/usr.sbin/vmctl/main.c
index 521eeaa9fe5..600e2efe4bd 100644
--- a/usr.sbin/vmctl/main.c
+++ b/usr.sbin/vmctl/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.53 2019/03/01 10:34:14 kn Exp $ */
+/* $OpenBSD: main.c,v 1.54 2019/03/01 12:47:36 kn Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -598,6 +598,8 @@ ctl_create(struct parse_result *res, int argc, char *argv[])
/* NOTREACHED */
}
}
+ argc -= optind;
+ argv += optind;
if (argc > 0)
ctl_usage(res->ctl);
@@ -915,6 +917,8 @@ ctl_start(struct parse_result *res, int argc, char *argv[])
/* NOTREACHED */
}
}
+ argc -= optind;
+ argv += optind;
if (argc > 0)
ctl_usage(res->ctl);
@@ -959,6 +963,8 @@ ctl_stop(struct parse_result *res, int argc, char *argv[])
/* NOTREACHED */
}
}
+ argc -= optind;
+ argv += optind;
if (argc > 0)
ctl_usage(res->ctl);