bitvec: Fix decoding of H / L values

it returns if a given bit in the vector is "high" or "low".
the bitval that represents "high" depends on the bit position.
bitval2mask returns that. so we must check if the bit in the vector
equals the returned bitval.
This commit is contained in:
Andreas.Eversberg 2010-10-24 11:59:33 +02:00 committed by Sylvain Munaut
parent acffb60c1a
commit dc0ebdfbdf
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ enum bit_value bitvec_get_bit_pos_high(const struct bitvec *bv,
bitval = bitval2mask(H, bitnum); bitval = bitval2mask(H, bitnum);
if (bv->data[bytenum] & bitval) if ((bv->data[bytenum] & (1 << bitnum)) == bitval)
return H; return H;
return L; return L;