[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help needed on #95010



Craig Small <csmall@eye-net.com.au> wrote:

>        *i = strtol(m->buffer, &p, 10);
> -       if (((*i == LONG_MAX) || (*i == LONG_MIN)) && (errno == ERANGE)) {
> +       if (((*i == (int)LONG_MAX) || (*i == (int)LONG_MIN)) && (errno == ERANGE)) {

This is not right.  You should save the result in a real long and then
test for errors before putting the value in *i.
-- 
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



Reply to: