On Mon, Jun 21, 2010 at 08:24:51AM +0000, Andrey V. Elsukov wrote:
> +done:
> +     if (mult * unit < mult || number * mult * unit < number)
> +             return (ERANGE);

A general rule is: don't check for overflow when it already occurs,
since result can be any, including valid ones.
Redo it to before overflow stage (using things like OFF_MAX / unit).

-- 
http://ache.pp.ru/
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to