mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-01 14:31:52 -06:00
bsd-user: use qemu_strtoul in preference to strtol
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
This commit is contained in:
parent
b23a51dc91
commit
29aabb4fc3
1 changed files with 8 additions and 4 deletions
|
@ -36,6 +36,7 @@
|
||||||
#include "tcg/tcg.h"
|
#include "tcg/tcg.h"
|
||||||
#include "qemu/timer.h"
|
#include "qemu/timer.h"
|
||||||
#include "qemu/envlist.h"
|
#include "qemu/envlist.h"
|
||||||
|
#include "qemu/cutils.h"
|
||||||
#include "exec/log.h"
|
#include "exec/log.h"
|
||||||
#include "trace/control.h"
|
#include "trace/control.h"
|
||||||
|
|
||||||
|
@ -612,7 +613,7 @@ int main(int argc, char **argv)
|
||||||
TaskState ts1, *ts = &ts1;
|
TaskState ts1, *ts = &ts1;
|
||||||
CPUArchState *env;
|
CPUArchState *env;
|
||||||
CPUState *cpu;
|
CPUState *cpu;
|
||||||
int optind;
|
int optind, rv;
|
||||||
const char *r;
|
const char *r;
|
||||||
const char *gdbstub = NULL;
|
const char *gdbstub = NULL;
|
||||||
char **target_environ, **wrk;
|
char **target_environ, **wrk;
|
||||||
|
@ -677,8 +678,8 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
} else if (!strcmp(r, "s")) {
|
} else if (!strcmp(r, "s")) {
|
||||||
r = argv[optind++];
|
r = argv[optind++];
|
||||||
x86_stack_size = strtol(r, (char **)&r, 0);
|
rv = qemu_strtoul(r, &r, 0, &x86_stack_size);
|
||||||
if (x86_stack_size <= 0) {
|
if (rv < 0 || x86_stack_size <= 0) {
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
if (*r == 'M') {
|
if (*r == 'M') {
|
||||||
|
@ -709,7 +710,10 @@ int main(int argc, char **argv)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
} else if (!strcmp(r, "B")) {
|
} else if (!strcmp(r, "B")) {
|
||||||
guest_base = strtol(argv[optind++], NULL, 0);
|
rv = qemu_strtoul(argv[optind++], NULL, 0, &guest_base);
|
||||||
|
if (rv < 0) {
|
||||||
|
usage();
|
||||||
|
}
|
||||||
have_guest_base = true;
|
have_guest_base = true;
|
||||||
} else if (!strcmp(r, "drop-ld-preload")) {
|
} else if (!strcmp(r, "drop-ld-preload")) {
|
||||||
(void) envlist_unsetenv(envlist, "LD_PRELOAD");
|
(void) envlist_unsetenv(envlist, "LD_PRELOAD");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue