Ticket #415: int_sqrt-terminate1.patch

File int_sqrt-terminate1.patch, 417 bytes (added by timo lindfors, 12 years ago)

proposed fix

  • navit/graphics.c

     
    10141014        unsigned int h, p= 0, q= 1, r= n;
    10151015
    10161016        /* avoid q rollover */
    1017         if(n > (1<<(sizeof(n)*8-1))) {
    1018                 q = 1<<(sizeof(n)*8-1);
     1017        if(n >= (1<<(sizeof(n)*8-2))) {
     1018                q = 1<<(sizeof(n)*8-2);
    10191019        } else {
    10201020                while ( q <= n ) {
    10211021                        q <<= 2;