diff options
author | kn <kn@cvs.openbsd.org> | 2019-10-27 08:59:49 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2019-10-27 08:59:49 +0000 |
commit | ac93721b54e414827cbd273b25f3d7acc5e5272d (patch) | |
tree | e128978c467c4bf4c3c5a3d71b2c3c98a7b15e6c /usr.sbin/vmctl/main.c | |
parent | b59c953afa1239baf469fb36c680778ccefb54a5 (diff) |
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
Diffstat (limited to 'usr.sbin/vmctl/main.c')
-rw-r--r-- | usr.sbin/vmctl/main.c | 6 |
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); } } |