Coverity check please...

Hal Murray halmurray at sonic.net
Mon Jan 20 04:18:52 UTC 2025


Gary said:
> Since j is 2, andi is 3, subtracting i from j caused integer wrap, which
> is undefined. 

That assumes it goes around the loop a couple of times.  But it doesn't go 
around the loop even once -- or I'm confused.

We get here with n=2
It looks to me like m gets initialized to 2.  Do you gt a different answer?
> 471        i = 0; j = n;
> 472        m = n - (n * 4) / 10;
> 473        while ((j - i) > m) {


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list