diff options
-rw-r--r-- | vl.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2535,9 +2535,10 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_m: { int64_t value; + char *end; - value = strtosz(optarg, NULL); - if (value < 0) { + value = strtosz(optarg, &end); + if (value < 0 || *end) { fprintf(stderr, "qemu: invalid ram size: %s\n", optarg); exit(1); } |