summaryrefslogtreecommitdiff
path: root/usr.sbin/vmctl
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2016-01-26 07:55:48 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2016-01-26 07:55:48 +0000
commita05c51a3a1956511b8ed28c31ae7e9fa09c9e653 (patch)
tree1c5cb44b6557892853287a8634c1b59529e2e27b /usr.sbin/vmctl
parent6997f77706a8c518a9c9cd84e1291b93f2065cc4 (diff)
The division "res->size /= 1024 / 1024" is a no-op: 1024 / 1024 is
evaluated first, resulting in res->size /= 1. Remove the division and the following check, as it can never fail; it is a left-over from previous code that didn't check the size in the caller. From Martin Natano OK mlarkin@
Diffstat (limited to 'usr.sbin/vmctl')
-rw-r--r--usr.sbin/vmctl/main.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/usr.sbin/vmctl/main.c b/usr.sbin/vmctl/main.c
index b0352f42c98..eed09034198 100644
--- a/usr.sbin/vmctl/main.c
+++ b/usr.sbin/vmctl/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.13 2016/01/05 16:25:34 semarie Exp $ */
+/* $OpenBSD: main.c,v 1.14 2016/01/26 07:55:47 reyk Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -421,9 +421,6 @@ ctl_create(struct parse_result *res, int argc, char *argv[])
fprintf(stderr, "missing size argument\n");
ctl_usage(res->ctl);
}
- res->size /= 1024 / 1024;
- if (res->size < 1)
- errx(1, "specified image size too small");
ret = create_imagefile(paths[0], res->size);
if (ret != 0) {
errno = ret;