Get rid of integer overflow warning.

PR:		misc/3575
Submitted by:	Bruce Evans <bde@zeta.org.au>
This commit is contained in:
steve 1997-08-23 23:51:12 +00:00
parent ed2190ca0b
commit 07ee29d4fd
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ strtoq(nptr, endptr, base)
* overflow.
*/
qbase = (unsigned)base;
cutoff = neg ? -(u_quad_t)QUAD_MIN : QUAD_MAX;
cutoff = neg ? (u_quad_t)-(QUAD_MIN + QUAD_MAX) + QUAD_MAX : QUAD_MAX;
cutlim = cutoff % qbase;
cutoff /= qbase;
for (acc = 0, any = 0;; c = *s++) {

View File

@ -105,7 +105,7 @@ strtoq(nptr, endptr, base)
* overflow.
*/
qbase = (unsigned)base;
cutoff = neg ? -(u_quad_t)QUAD_MIN : QUAD_MAX;
cutoff = neg ? (u_quad_t)-(QUAD_MIN + QUAD_MAX) + QUAD_MAX : QUAD_MAX;
cutlim = cutoff % qbase;
cutoff /= qbase;
for (acc = 0, any = 0;; c = *s++) {