Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -974,11 +974,11 @@ - (intmax_t)decimalValue { int i = 0; intmax_t num = 0; - if (string[0] == '-') + if (string[0] == '-' || string[0] == '+') i++; for (; i < length; i++) { if (string[i] >= '0' && string[i] <= '9') { if (INTMAX_MAX / 10 < num || Index: tests/OFStringTests.m ================================================================== --- tests/OFStringTests.m +++ tests/OFStringTests.m @@ -226,10 +226,11 @@ [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @""]) TEST(@"-[decimalValue]", [@"1234" decimalValue] == 1234 && + [@"+123" decimalValue] == 123 && [@"-500" decimalValue] == -500 && [@"" decimalValue] == 0) TEST(@"-[hexadecimalValue]", [@"123f" hexadecimalValue] == 0x123f &&