mirror of https://gerrit.osmocom.org/libosmocore
bts_features: fix: properly check the result of bitvec_get_bit_pos()
If a feature index does not fit to the feature vector, this function would return a negative number that would be casted to true. This is wrong, we should return false instead. Change-Id: Id1ad92e7654a806bb920ae9507c88a122e8d09f0
This commit is contained in:
parent
b795f03faf
commit
f8e153d815
|
@ -40,5 +40,5 @@ static inline int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_fe
|
|||
static inline bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
|
||||
{
|
||||
OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
|
||||
return bitvec_get_bit_pos(features, feature);
|
||||
return bitvec_get_bit_pos(features, feature) == ONE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue