From a6b35141e4d38b045182d0820cf4e3e9bd2143eb Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 22 Nov 2013 13:31:52 -0800 Subject: Don't parse 32bit hex values with strtol On a 32bit machine this will truncate values with MSB set to 0x7fffffff Fixes #164 (thanks to Linus for pointing me in the right direction) Signed-off-by: Dirk Hohndel --- parse-xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parse-xml.c') diff --git a/parse-xml.c b/parse-xml.c index a7a44c5d0..97c93fc6d 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -656,7 +656,7 @@ static void double_to_permil(char *buffer, void *_i) static void hex_value(char *buffer, void *_i) { uint32_t *i = _i; - *i = strtol(buffer, NULL, 16); + *i = strtoul(buffer, NULL, 16); } static void get_tripflag(char *buffer, void *_tf) -- cgit v1.2.3-70-g09d2