From efcd9dfc35db504f403460796f1045977170fe90 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 19 Oct 2013 16:12:52 +0200 Subject: ConfigData: use strtoul() in GetUnsignedValue() Lifts the artificial 31 bit limit in i386 where sizeof(long)==sizeof(int). --- src/ConfigData.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ConfigData.cxx b/src/ConfigData.cxx index 9712eef3e..c6cabee6e 100644 --- a/src/ConfigData.cxx +++ b/src/ConfigData.cxx @@ -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; } -- cgit v1.2.3