diff options
author | Sergio Lopez <slp@redhat.com> | 2019-10-10 15:49:39 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-10-22 09:38:42 +0200 |
commit | 133ef074bd88957c0ed5b38d4489111889acf915 (patch) | |
tree | 8d2790f949a4d9dafa9faecfd7bfb948ef033643 /hw/i386 | |
parent | 62a188546ff9dec8020776c04a728ff62d2b4aeb (diff) | |
download | qemu-133ef074bd88957c0ed5b38d4489111889acf915.zip |
hw/i386/pc: replace use of strtol with qemu_strtoui in x86_load_linux()
Follow checkpatch.pl recommendation and replace the use of strtol with
qemu_strtoui in x86_load_linux().
Signed-off-by: Sergio Lopez <slp@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r-- | hw/i386/pc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 75a97c2157..b5b660f941 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -68,6 +68,7 @@ #include "qemu/config-file.h" #include "qemu/error-report.h" #include "qemu/option.h" +#include "qemu/cutils.h" #include "hw/acpi/acpi.h" #include "hw/acpi/cpu_hotplug.h" #include "hw/boards.h" @@ -1202,6 +1203,7 @@ static void x86_load_linux(PCMachineState *pcms, vmode = strstr(kernel_cmdline, "vga="); if (vmode) { unsigned int video_mode; + int ret; /* skip "vga=" */ vmode += 4; if (!strncmp(vmode, "normal", 6)) { @@ -1211,7 +1213,12 @@ static void x86_load_linux(PCMachineState *pcms, } else if (!strncmp(vmode, "ask", 3)) { video_mode = 0xfffd; } else { - video_mode = strtol(vmode, NULL, 0); + ret = qemu_strtoui(vmode, NULL, 0, &video_mode); + if (ret != 0) { + fprintf(stderr, "qemu: can't parse 'vga' parameter: %s\n", + strerror(-ret)); + exit(1); + } } stw_p(header + 0x1fa, video_mode); } |