mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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 <dirk@hohndel.org>
This commit is contained in:
parent
781266bf18
commit
a6b35141e4
2 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ typedef struct device_data_t {
|
|||
dc_descriptor_t *descriptor;
|
||||
const char *vendor, *product, *devname;
|
||||
const char *model;
|
||||
unsigned int deviceid, diveid;
|
||||
uint32_t deviceid, diveid;
|
||||
dc_device_t *device;
|
||||
dc_context_t *context;
|
||||
int preexisting;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue