aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mrdisc.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2016-01-20 22:28:58 +0100
committerMartin Kaiser <wireshark@kaiser.cx>2016-01-20 21:34:53 +0000
commit8c2af23c16f467337e2566dbd97c4148c618afd6 (patch)
tree3879b1162d5e66f97dbf061f8d9525390b7c5757 /epan/dissectors/packet-mrdisc.c
parent92f76d0b696a165fa3f3cd8724aee8d2c816a6d5 (diff)
mrdisc: remove unnecessary if(item) checks
Change-Id: I9eb9b95274630a206a6f7036ee4b78a036ea56f1 Reviewed-on: https://code.wireshark.org/review/13461 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-mrdisc.c')
-rw-r--r--epan/dissectors/packet-mrdisc.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/epan/dissectors/packet-mrdisc.c b/epan/dissectors/packet-mrdisc.c
index 19ab0c1141..e91d6b0d3c 100644
--- a/epan/dissectors/packet-mrdisc.c
+++ b/epan/dissectors/packet-mrdisc.c
@@ -124,11 +124,9 @@ dissect_mrdisc_mra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, i
switch (type) {
case MRDISC_QI:
- if (item) {
- proto_item_set_text(item,"Option: %s == %d",
+ proto_item_set_text(item,"Option: %s == %d",
val_to_str(type, mrdisc_options, "unknown %x"),
tvb_get_ntohs(tvb, offset));
- }
if (len != 2)
THROW(ReportedBoundsError);
@@ -137,11 +135,9 @@ dissect_mrdisc_mra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, i
offset += len;
break;
case MRDISC_RV:
- if (item) {
- proto_item_set_text(item,"Option: %s == %d",
+ proto_item_set_text(item,"Option: %s == %d",
val_to_str(type, mrdisc_options, "unknown %x"),
tvb_get_ntohs(tvb, offset));
- }
if (len != 2)
THROW(ReportedBoundsError);
@@ -150,17 +146,13 @@ dissect_mrdisc_mra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, i
offset += len;
break;
default:
- if (item) {
- proto_item_set_text(item,"Option: unknown");
- }
+ proto_item_set_text(item,"Option: unknown");
proto_tree_add_item(tree, hf_option_bytes,
tvb, offset, len, ENC_NA);
offset += len;
}
- if (item) {
- proto_item_set_len(item, offset-old_offset);
- }
+ proto_item_set_len(item, offset-old_offset);
}
return offset;