summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorabs <abs@NetBSD.org>2012-06-25 16:47:03 +0000
committerabs <abs@NetBSD.org>2012-06-25 16:47:03 +0000
commita97dc79585de960f2c4121758c9fbfd44644dbf5 (patch)
tree43b643d5eca2800e1194c3491ae87cd096493878 /dist
parentd68fdae4bfadf6b38353291b8741b87f3f400343 (diff)
Casting an uint32_t pointer to (long *) may have been acceptable
in the eighties but that time has long past. Minimally invasive fix using a temporary long variable, so while we can still overflow at least we're less broken.
Diffstat (limited to 'dist')
-rw-r--r--dist/pdisk/partition_map.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dist/pdisk/partition_map.c b/dist/pdisk/partition_map.c
index 6ee62c3eaa6..c7bf88bd269 100644
--- a/dist/pdisk/partition_map.c
+++ b/dist/pdisk/partition_map.c
@@ -514,12 +514,14 @@ create_partition_map(char *name, partition_map_header *oldmap)
default_number = number;
flush_to_newline(0);
do {
+ long long_number = number;
if (get_number_argument("what should be the size? ",
- (long *)&number, default_number) == 0) {
+ &long_number, default_number) == 0) {
printf("Not a number\n");
flush_to_newline(1);
number = 0;
} else {
+ number = long_number;
multiple = get_multiplier(map->logical_block);
if (multiple == 0) {
printf("Bad multiplier\n");