summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-10-04 15:34:58 +0200
committerPeter Wu <peter@lekensteyn.nl>2015-10-04 13:43:46 +0000
commit71ec57ab8bde0c414a03969cb00a1412179f7e37 (patch)
tree749d46c2f8a2b70d03132cb144eb36205282b96e
parent5c17f1f5afe8fcbd44d4853734170e5c037335bb (diff)
downloadwireshark-71ec57ab8bde0c414a03969cb00a1412179f7e37.tar.gz
bacapp: fix -Wshift-negative-value
Shifting a negative signed value is undefined. Found by Clang. Change-Id: If58d7b82899859892d8c58d627e98a8a902dd7fd Reviewed-on: https://code.wireshark.org/review/10780 Reviewed-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r--epan/dissectors/packet-bacapp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c
index bcfa58efb4..d5726bd06c 100644
--- a/epan/dissectors/packet-bacapp.c
+++ b/epan/dissectors/packet-bacapp.c
@@ -5296,12 +5296,12 @@ fSigned64(tvbuff_t *tvb, guint offset, guint32 lvt, gint64 *val)
valid = TRUE;
data = tvb_get_guint8(tvb, offset);
if ((data & 0x80) != 0)
- value = (-1 << 8) | data;
+ value = (G_GUINT64_CONSTANT(-1) << 8) | data;
else
value = data;
for (i = 1; i < lvt; i++) {
data = tvb_get_guint8(tvb, offset+i);
- value = (value << 8) + data;
+ value = ((guint64)value << 8) | data;
}
*val = value;
}