Fix two bugs in SCRIPT_GetNumber that cause it to issue an incorrect return value.

git-svn-id: https://svn.eduke32.com/eduke32@5469 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-12-20 05:18:56 +00:00
parent 00bc250811
commit a5367ed600

View file

@ -724,13 +724,13 @@ int32_t SCRIPT_GetNumber(int32_t scripthandle, const char * sectionname, const c
{
// hex
*number = strtol(e->value+2, &p, 16);
if (p == e->value || *p != 0 || *p != ' ' || *p != '\t') return 1;
if (p == e->value+2 || (*p != 0 && *p != ' ' && *p != '\t')) return 1;
}
else
{
// decimal
*number = strtol(e->value, &p, 10);
if (p == e->value || *p != 0 || *p != ' ' || *p != '\t') return 1;
if (p == e->value || (*p != 0 && *p != ' ' && *p != '\t')) return 1;
}
}