diff options
author | Andreas.Eversberg <jolly@eversberg.eu> | 2010-10-24 11:59:33 +0200 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2010-10-24 11:59:33 +0200 |
commit | dc0ebdfbdf3b1a381754c6ef4a59b0354eba7705 (patch) | |
tree | c6cc91d2b4ced96c2b756345aa508c01395a760c | |
parent | acffb60c1af6a30a99c969483ab46920d2fd966f (diff) |
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.
-rw-r--r-- | src/bitvec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bitvec.c b/src/bitvec.c index 04c465a8..95d78a5c 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -90,7 +90,7 @@ enum bit_value bitvec_get_bit_pos_high(const struct bitvec *bv, bitval = bitval2mask(H, bitnum); - if (bv->data[bytenum] & bitval) + if ((bv->data[bytenum] & (1 << bitnum)) == bitval) return H; return L; |