We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4c8a1f commit 0e5e14fCopy full SHA for 0e5e14f
unix/main.c
@@ -351,12 +351,20 @@ STATIC void pre_process_options(int argc, char **argv) {
351
heap_size *= 1024;
352
} else if ((*end | 0x20) == 'm') {
353
heap_size *= 1024 * 1024;
354
+ } else {
355
+ // Compensate for ++ below
356
+ --end;
357
+ }
358
+ if (*++end != 0) {
359
+ goto invalid_arg;
360
}
361
if (word_adjust) {
362
heap_size = heap_size * BYTES_PER_WORD / 4;
363
364
#endif
365
} else {
366
+invalid_arg:
367
+ printf("Invalid option\n");
368
exit(usage(argv));
369
370
a++;
0 commit comments