summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkn <kn@openbsd.org>2019-10-27 08:59:48 +0000
committerkn <kn@openbsd.org>2019-10-27 08:59:48 +0000
commit0f0fb1d3b5110f5f068462c4525184ac8bd7f77b (patch)
treeaa3f69f927d5d2e9ca42c49e68aefbd6f08bc631
parentAdd simplefb(4). (diff)
downloadwireguard-openbsd-0f0fb1d3b5110f5f068462c4525184ac8bd7f77b.tar.xz
wireguard-openbsd-0f0fb1d3b5110f5f068462c4525184ac8bd7f77b.zip
Require at least one interface with -i
Either a positive count is given or -i is omitted entirely; vm.conf(5) does not allow interface configuration that results in zero interfaces either. Raise the minimium count value to one and tell more about invalid counts with the usual strtonum(3) idiom. OK reyk
-rw-r--r--usr.sbin/vmctl/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/vmctl/main.c b/usr.sbin/vmctl/main.c
index 3eb89c9fe96..1a5264b84fd 100644
--- a/usr.sbin/vmctl/main.c
+++ b/usr.sbin/vmctl/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.58 2019/08/23 07:55:20 mlarkin Exp $ */
+/* $OpenBSD: main.c,v 1.59 2019/10/27 08:59:48 kn Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -373,9 +373,9 @@ parse_ifs(struct parse_result *res, char *word, int val)
const char *error;
if (word != NULL) {
- val = strtonum(word, 0, INT_MAX, &error);
+ val = strtonum(word, 1, INT_MAX, &error);
if (error != NULL) {
- warnx("invalid count \"%s\": %s", word, error);
+ warnx("count is %s: %s", error, word);
return (-1);
}
}