unix/main: Error out on unknown value of suffix in -X heapsize= option.
E.g. -X heapsize=16Kfoo, -X heapsize=1G will lead to error.
This commit is contained in:
parent
a4c8a1ffe8
commit
0e5e14fe7c
@ -351,12 +351,20 @@ STATIC void pre_process_options(int argc, char **argv) {
|
||||
heap_size *= 1024;
|
||||
} else if ((*end | 0x20) == 'm') {
|
||||
heap_size *= 1024 * 1024;
|
||||
} else {
|
||||
// Compensate for ++ below
|
||||
--end;
|
||||
}
|
||||
if (*++end != 0) {
|
||||
goto invalid_arg;
|
||||
}
|
||||
if (word_adjust) {
|
||||
heap_size = heap_size * BYTES_PER_WORD / 4;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
invalid_arg:
|
||||
printf("Invalid option\n");
|
||||
exit(usage(argv));
|
||||
}
|
||||
a++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user