bug in glib.h / g_bit_nth_msf



I found an off-by-one error in glib.h in the g_bit_nth_msf macro.  It sets
nth_bit to 33 in case it's called with nth_bit < 0.  This value is reduced by
one immediately thereafter, but 1<<32 is off limits for a 32 bit variable.
Also nth_bit shouldn't be checked for <0 but <1.

-- 
Andreas E. Bombe <andreas.bombe@munich.netsurf.de>
http://home.pages.de/~andreas.bombe/

PGP 1024bit ID:0x886663c9 fingerprint: 30EC0973847B5583 C47A91D99DC54BB0
    2048bit ID:0xF62D5CC1 fingerprint: 136BBC1536B8B77A 200558E86FAAF8ED



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]