incorrect behavior occurred only in cases where the input overflows
unsigned long long, not just the (possibly lower) range limit for the
result type. in this case, processing of the '-' sign character was
not suppressed, and the function returned a value of 1 despite setting
errno to ERANGE.
(cherry picked from commit
e2e1bb81485a37321d928a8d8b63f40b9d8fa228)
for (; val[c]<base; c=shgetc(f));
errno = ERANGE;
y = lim;
+ if (lim&1) neg = 0;
}
done:
shunget(f);