ConfigData: use strtoul() in GetUnsignedValue()
Lifts the artificial 31 bit limit in i386 where sizeof(long)==sizeof(int).
This commit is contained in:
parent
db44a6e948
commit
efcd9dfc35
@ -44,13 +44,10 @@ unsigned
|
|||||||
block_param::GetUnsignedValue() const
|
block_param::GetUnsignedValue() const
|
||||||
{
|
{
|
||||||
char *endptr;
|
char *endptr;
|
||||||
long value2 = strtol(value.c_str(), &endptr, 0);
|
unsigned long value2 = strtoul(value.c_str(), &endptr, 0);
|
||||||
if (*endptr != 0)
|
if (*endptr != 0)
|
||||||
FormatFatalError("Not a valid number in line %i", line);
|
FormatFatalError("Not a valid number in line %i", line);
|
||||||
|
|
||||||
if (value2 < 0)
|
|
||||||
FormatFatalError("Not a positive number in line %i", line);
|
|
||||||
|
|
||||||
return (unsigned)value2;
|
return (unsigned)value2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user