diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-04-30 15:39:16 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-04-30 22:39:42 +0000 |
commit | 7a308e737deba7ffff5bf07d49e8e294cc9ddb4a (patch) | |
tree | efcb42cfe39f9bc12ed0a9e218dcedcc19d382d0 /epan/dissectors/packet-ieee80211-radiotap.c | |
parent | 9fba5f0764678cfed4b7ff2a41fdcb0babcdbf55 (diff) |
Fix some cases where we're shifting a signed 1 left.
Shift 1U instead, to make sure it's unsigned; the result of, for
example, the result of shifting a signed value left is undefined if the
value times 2^{shift count} doesn't fit in the *signed* type of the
shifted value. That means, in particular, that the result of shifting 1
left by {number of bits in an int - 1} is undefined. (In *practice*,
it'll probably be -2^32, with the bit you want set, but that's not
guaranteed, and GCC 5.1 seems not to like it.)
Change-Id: I96114047d402d1bae537cdfeb28a8564b1c94712
Reviewed-on: https://code.wireshark.org/review/8256
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-ieee80211-radiotap.c')
-rw-r--r-- | epan/dissectors/packet-ieee80211-radiotap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c index a79991178c..93a5b7c832 100644 --- a/epan/dissectors/packet-ieee80211-radiotap.c +++ b/epan/dissectors/packet-ieee80211-radiotap.c @@ -228,7 +228,7 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree); #define BITNO_8(x) (((x) >> 4) ? 4 + BITNO_4((x) >> 4) : BITNO_4((x))) #define BITNO_4(x) (((x) >> 2) ? 2 + BITNO_2((x) >> 2) : BITNO_2((x))) #define BITNO_2(x) (((x) & 2) ? 1 : 0) -#define BIT(n) (1 << n) +#define BIT(n) (1U << n) /* not officially defined (yet) */ #define IEEE80211_RADIOTAP_F_SHORTGI 0x80 |