Get rid of integer overflow warning.

PR:		misc/3575
Submitted by:	Bruce Evans <bde@zeta.org.au>
This commit is contained in:
Steve Price 1997-08-23 23:51:12 +00:00
parent 1e915c361e
commit a89989b26f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28640
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++) {