diff options
| author | Mark Wielaard <[email protected]> | 2015-05-19 23:08:00 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2015-05-27 17:17:51 +0200 |
| commit | d76d73f490b1e097e650bb77277ae9ed1efd5b1a (patch) | |
| tree | 03ddb833b702c1b0f4a42ad78a08a40d51820a76 /src/addr2line.c | |
| parent | 472890f580a83f1511e1ad83c10ea2b1d364cc8d (diff) | |
addr2line: Always parse addresses as hex numbers.
We would sometimes interpret input addresses as decimal or octal.
That could be confusing and isn't what binutils addr2line does.
Be consistent and always treat input addresses as hex.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'src/addr2line.c')
| -rw-r--r-- | src/addr2line.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/addr2line.c b/src/addr2line.c index c7ff7f71..b1ff3680 100644 --- a/src/addr2line.c +++ b/src/addr2line.c @@ -532,8 +532,8 @@ static int handle_address (const char *string, Dwfl *dwfl) { char *endp; - uintmax_t addr = strtoumax (string, &endp, 0); - if (endp == string) + uintmax_t addr = strtoumax (string, &endp, 16); + if (endp == string || *endp != '\0') { bool parsed = false; int i, j; |
