aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iax2.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2015-09-16 22:29:18 +0200
committerAnders Broman <a.broman58@gmail.com>2015-09-17 06:24:35 +0000
commitfade468864de78a76f584cc62edeab8e55bd7973 (patch)
treecf7aa41f5c4ca9012be44c290bb823e05db72ec2 /epan/dissectors/packet-iax2.c
parente036ec07cbab494cec871403f7a90c68ea73929d (diff)
downloadwireshark-fade468864de78a76f584cc62edeab8e55bd7973.tar.gz
wireshark-fade468864de78a76f584cc62edeab8e55bd7973.tar.bz2
wireshark-fade468864de78a76f584cc62edeab8e55bd7973.zip
[iax2] minor cleanup
replace switch-case with if remove an initial value that's overwritten immediately Change-Id: I98487ed08f91416179fcbbbaf80bf1b126a8d1c2 Reviewed-on: https://code.wireshark.org/review/10548 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-iax2.c')
-rw-r--r--epan/dissectors/packet-iax2.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index 36f195a875..77d8cd1f87 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -1374,15 +1374,11 @@ static guint32 dissect_ies(tvbuff_t *tvb, packet_info *pinfo, guint32 offset,
apparent_addr_family = tvb_get_letohs(tvb, offset+2);
proto_tree_add_uint(sockaddr_tree, hf_IAX_IE_APPARENTADDR_SINFAMILY, tvb, offset + 2, 2, apparent_addr_family);
- switch (apparent_addr_family) {
- case LINUX_AF_INET:
- {
- guint32 addr;
- proto_tree_add_uint(sockaddr_tree, hf_IAX_IE_APPARENTADDR_SINPORT, tvb, offset + 4, 2, ie_data->peer_port);
- memcpy(&addr, ie_data->peer_address.data, 4);
- proto_tree_add_ipv4(sockaddr_tree, hf_IAX_IE_APPARENTADDR_SINADDR, tvb, offset + 6, 4, addr);
- break;
- }
+ if (apparent_addr_family == LINUX_AF_INET) {
+ guint32 addr;
+ proto_tree_add_uint(sockaddr_tree, hf_IAX_IE_APPARENTADDR_SINPORT, tvb, offset + 4, 2, ie_data->peer_port);
+ memcpy(&addr, ie_data->peer_address.data, 4);
+ proto_tree_add_ipv4(sockaddr_tree, hf_IAX_IE_APPARENTADDR_SINADDR, tvb, offset + 6, 4, addr);
}
break;
}
@@ -1481,8 +1477,7 @@ static guint32 dissect_ies(tvbuff_t *tvb, packet_info *pinfo, guint32 offset,
proto_item_set_text(ti, "Information Element: %s",
ie_finfo->rep->representation);
else {
- guint8 *ie_val = NULL;
- ie_val = (guint8 *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH);
+ guint8 *ie_val = (guint8 *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH);
proto_item_fill_label(ie_finfo, ie_val);
proto_item_set_text(ti, "Information Element: %s",
ie_val);