Yo Hal! On Mon, 20 Jan 2025 15:39:37 -0800 Hal Murray <halmur...@sonic.net> wrote:
> > Still seems like a bug to me. Any potential UB is bad. Should be > > easy to work around. > > Please look at the code. It's only 10 lines. I did. > If you can suggest a fix, I'll try it. Check for the underflow/overflow before the subtraction. > 473 while ((j - i) > m) { while (1) { if (j <= i) { /* avoid integer wraparound * also if j == i, then (j - i) == 0 and 0 can not * be > m */ break; } if ((j - i) <= m) { // done. break; } RGDS GARY --------------------------------------------------------------------------- Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703 g...@rellim.com Tel:+1 541 382 8588 Veritas liberabit vos. -- Quid est veritas? "If you can't measure it, you can't improve it." - Lord Kelvin _______________________________________________ devel mailing list devel@ntpsec.org https://lists.ntpsec.org/mailman/listinfo/devel