From: ceriel Date: Tue, 27 Feb 1990 14:30:10 +0000 (+0000) Subject: improved test for overflow X-Git-Tag: release-5-5~1807 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=d35a781049b64dcb0399c1bffa203287a0f42890;p=ack.git improved test for overflow --- diff --git a/modules/src/string/long2str.c b/modules/src/string/long2str.c index d09e6542b..7052ecaec 100644 --- a/modules/src/string/long2str.c +++ b/modules/src/string/long2str.c @@ -26,8 +26,10 @@ long2str(val, base) if (val) { if (base > 0) { if (val < 0L) { - if ((val = -val) < 0L) + long v1 = -val; + if (v1 == val) goto overflow; + val = v1; } else sign = 0;