mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use strtoul to parse unsigned values
Otherwise reading in the dive site uuids will break on 32bit machines (as all values >= 0x80000000 will be truncated to LONG_MAX). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
298f023e1f
commit
f2b1132c33
1 changed files with 1 additions and 1 deletions
|
@ -1427,7 +1427,7 @@ static int parse_site_entry(git_repository *repo, const git_tree_entry *entry, c
|
||||||
if (*suffix == '\0')
|
if (*suffix == '\0')
|
||||||
return report_error("Dive site without uuid");
|
return report_error("Dive site without uuid");
|
||||||
struct dive_site *ds = alloc_dive_site();
|
struct dive_site *ds = alloc_dive_site();
|
||||||
ds->uuid = strtol(suffix, NULL, 16);
|
ds->uuid = strtoul(suffix, NULL, 16);
|
||||||
git_blob *blob = git_tree_entry_blob(repo, entry);
|
git_blob *blob = git_tree_entry_blob(repo, entry);
|
||||||
if (!blob)
|
if (!blob)
|
||||||
return report_error("Unable to read dive site file");
|
return report_error("Unable to read dive site file");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue