summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2016-01-26 07:55:47 +0000
committerreyk <reyk@openbsd.org>2016-01-26 07:55:47 +0000
commit13aede6bf9111c274e03d276b5625b1481de1a73 (patch)
tree5dfbc190c762092f70f67cb7f71977d312a90ee6
parentSimplify logic of read_partition_map(), junking retries with various sizes (diff)
downloadwireguard-openbsd-13aede6bf9111c274e03d276b5625b1481de1a73.tar.xz
wireguard-openbsd-13aede6bf9111c274e03d276b5625b1481de1a73.zip
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@
-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;