Handle oveflow in O(U)String::toInt() functions
Return 0 when overflow.
The base idea in unsigned case is checking wheather
(Max-nDigit)/nRadix < n
But for efficency, take out nDiv = Max/nRadix from loop
and corrigate it with -1 if needed.
In signed case use minimum value if the number is negativ.
Change-Id: I5b77580adbf12421b6c4b785ba9bc2a080accba2
Signed-off-by:
Stephan Bergmann <sbergman@redhat.com>
Showing
Please
register
or
sign in
to comment