aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-opa-mad.c
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2018-05-13 18:43:53 +0200
committerAnders Broman <a.broman58@gmail.com>2018-05-17 05:29:14 +0000
commitfd85b477d676de26453f919d0935bfac3cdf24f6 (patch)
tree6eadcf0ee55a7a518fc54b103f17e6b0720dd055 /epan/dissectors/packet-opa-mad.c
parent3a0b4d643182c2bff3a2e3c480ede538ff692dc3 (diff)
opa-mad: fix issue found by PVS Studio (V501)
There are identical sub-expressions to the left and to the right of the '&&' operator: vlSelMskTmp && i < 32 && vlSelMskTmp Change-Id: I23df4ac9217fe2ddc4b6691530abc609f644511a Reviewed-on: https://code.wireshark.org/review/27509 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-opa-mad.c')
-rw-r--r--epan/dissectors/packet-opa-mad.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-opa-mad.c b/epan/dissectors/packet-opa-mad.c
index c9262fb0c2..a95c394518 100644
--- a/epan/dissectors/packet-opa-mad.c
+++ b/epan/dissectors/packet-opa-mad.c
@@ -5937,7 +5937,7 @@ static gint parse_PortStatus(proto_tree *parentTree, tvbuff_t *tvb, gint *offset
return *offset;
VLSelectMask = tvb_get_ntohl(tvb, local_offset + 4);
- for (i = 0, VLs = 0, vlSelMskTmp = VLSelectMask; vlSelMskTmp && i < 32 && vlSelMskTmp; i++, vlSelMskTmp >>= 1) {
+ for (i = 0, VLs = 0, vlSelMskTmp = VLSelectMask; vlSelMskTmp && i < 32; i++, vlSelMskTmp >>= 1) {
VLs = VLs + (vlSelMskTmp & 0x1);
}
@@ -6136,7 +6136,7 @@ static gint parse_DataPortCounters(proto_tree *parentTree, tvbuff_t *tvb, gint *
return *offset;
VLSelectMask = tvb_get_ntohl(tvb, local_offset + 32);
- for (i = 0, VLs = 0, vlSelMskTmp = VLSelectMask; vlSelMskTmp && i < 32 && vlSelMskTmp; i++, vlSelMskTmp >>= 1) {
+ for (i = 0, VLs = 0, vlSelMskTmp = VLSelectMask; vlSelMskTmp && i < 32; i++, vlSelMskTmp >>= 1) {
VLs += (vlSelMskTmp & 0x1);
}