ConfigData: use strtoul() in GetUnsignedValue()

Lifts the artificial 31 bit limit in i386 where
sizeof(long)==sizeof(int).
This commit is contained in:
Max Kellermann 2013-10-19 16:12:52 +02:00
parent db44a6e948
commit efcd9dfc35

View File

@ -44,13 +44,10 @@ unsigned
block_param::GetUnsignedValue() const
{
char *endptr;
long value2 = strtol(value.c_str(), &endptr, 0);
unsigned long value2 = strtoul(value.c_str(), &endptr, 0);
if (*endptr != 0)
FormatFatalError("Not a valid number in line %i", line);
if (value2 < 0)
FormatFatalError("Not a positive number in line %i", line);
return (unsigned)value2;
}