mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-30 05:36:10 +00:00
Get rid of integer overflow warning.
PR: misc/3575 Submitted by: Bruce Evans <bde@zeta.org.au>
This commit is contained in:
parent
1e915c361e
commit
a89989b26f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28640
|
@ -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++) {
|
||||
|
|
|
@ -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++) {
|
||||
|
|
Loading…
Reference in a new issue