mirror of
https://github.com/crash-utility/crash
synced 2025-02-23 00:46:48 +00:00
Fix to the x86_64 "--machdep phys_base=<value>" command line option
to allow the use of a negative decimal number as the value. Without the patch, only the hexadecimal representation of the value would be accepted. (v-santy@microsoft.com, anderson@redhat.com)
This commit is contained in:
parent
9bee8ecbbe
commit
fee99ccfd2
13
x86_64.c
13
x86_64.c
@ -5999,13 +5999,12 @@ parse_cmdline_args(void)
|
||||
}
|
||||
p = arglist[i] + strlen("phys_base=");
|
||||
if (strlen(p)) {
|
||||
if (megabytes) {
|
||||
value = dtol(p, RETURN_ON_ERROR|QUIET,
|
||||
&errflag);
|
||||
} else
|
||||
value = htol(p, RETURN_ON_ERROR|QUIET,
|
||||
&errflag);
|
||||
if (!errflag) {
|
||||
if (hexadecimal(p, 0) && !decimal(p, 0) &&
|
||||
!STRNEQ(p, "0x") && !STRNEQ(p, "0X"))
|
||||
string_insert("0x", p);
|
||||
errno = 0;
|
||||
value = strtoull(p, NULL, 0);
|
||||
if (!errno) {
|
||||
if (megabytes)
|
||||
value = MEGABYTES(value);
|
||||
machdep->machspec->phys_base = value;
|
||||
|
Loading…
Reference in New Issue
Block a user