Commit efcd9dfc authored by Max Kellermann's avatar Max Kellermann

ConfigData: use strtoul() in GetUnsignedValue()

Lifts the artificial 31 bit limit in i386 where sizeof(long)==sizeof(int).
parent db44a6e9
...@@ -44,13 +44,10 @@ unsigned ...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment