- fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by
yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. SVN r1831 (trunk)
This commit is contained in:
parent
1c57ac3138
commit
3a6d66e230
2 changed files with 11 additions and 1 deletions
|
|
@ -958,7 +958,11 @@ static int PatchThing (int thingy)
|
|||
{
|
||||
if (IsNum (strval))
|
||||
{
|
||||
value[0] |= (unsigned long)strtol(strval, NULL, 10);
|
||||
// I have no idea why everyone insists on using strtol here even though it fails
|
||||
// dismally if a value is parsed where the highest bit it set. Do people really
|
||||
// use negative values here? Let's better be safe and check both.
|
||||
if (strchr(strval, '-')) value[0] |= (unsigned long)strtol(strval, NULL, 10);
|
||||
else value[0] |= (unsigned long)strtoul(strval, NULL, 10);
|
||||
vchanged[0] = true;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue