The decimal() function was changed in r217808 to take the

maximum value instead of number of bits. But for case when
limitation is not needed it erroneously skips conversion to
number and always returns zero. So, don't skip conversion
for case when limitation is not needed.

PR:		bin/159765
Approved by:	re (kib)
This commit is contained in:
ae 2011-08-19 12:48:06 +00:00
parent 1d37a981a8
commit 8b395ee11e

View File

@ -940,7 +940,7 @@ decimal(const char *str, int *num, int deflt, uint32_t maxval)
return 0;
while ((c = *cp++)) {
if (c <= '9' && c >= '0') {
if (maxval > 0 && acc <= maxval)
if (acc <= maxval || maxval == 0)
acc = acc * 10 + c - '0';
} else
break;