diff --git a/lib/int_sqrt.c b/lib/int_sqrt.c index db0b5aa071fc14e68fc3073e1a41c0d4617e65cf..036c96781ea85058eecbbb613460710e15107073 100644 --- a/lib/int_sqrt.c +++ b/lib/int_sqrt.c @@ -23,6 +23,9 @@ unsigned long int_sqrt(unsigned long x) return x; m = 1UL << (BITS_PER_LONG - 2); + while (m > x) + m >>= 2; + while (m != 0) { b = y + m; y >>= 1;