aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-atalk.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2011-01-16 03:46:16 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2011-01-16 03:46:16 +0000
commitd553df218ebcb9e76299592b0794f0553ed63ff7 (patch)
treed425f254e94d747cc030227516704d5e0f6123a9 /epan/dissectors/packet-atalk.c
parentf36e2be2874db3eb3917e2b9299509725d483ce3 (diff)
Use tvb_memeql().
Use tvb_ip_to_str(). There's no need to pass the result of tvb_get_ptr() as the 'value' in proto_tree_add_*(): just use proto_tree_add_item(). Replace some tvb_get_ptr()s with tvb_get_ephemeral_string()s to ensure the return string is NULL terminated. svn path=/trunk/; revision=35547
Diffstat (limited to 'epan/dissectors/packet-atalk.c')
-rw-r--r--epan/dissectors/packet-atalk.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/epan/dissectors/packet-atalk.c b/epan/dissectors/packet-atalk.c
index cc4dbd6c0b..3210fe306c 100644
--- a/epan/dissectors/packet-atalk.c
+++ b/epan/dissectors/packet-atalk.c
@@ -981,7 +981,6 @@ dissect_asp_reply_get_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
proto_tree *adr_tree;
char *tmp;
- const guint8 *ip;
guint16 net;
guint8 node;
guint16 port;
@@ -1108,13 +1107,12 @@ dissect_asp_reply_get_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
type = tvb_get_guint8(tvb, ofs +1);
switch (type) {
case 1: /* IP */
- ip = tvb_get_ptr(tvb, ofs+2, 4);
- ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip %s", ip_to_str(ip));
+ ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip %s", tvb_ip_to_str(tvb, ofs+2));
break;
case 2: /* IP + port */
- ip = tvb_get_ptr(tvb, ofs+2, 4);
port = tvb_get_ntohs(tvb, ofs+6);
- ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip %s:%u",ip_to_str(ip),port);
+ ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip %s:%u",
+ tvb_ip_to_str(tvb, ofs+2), port);
break;
case 3: /* DDP, atalk_addr_to_str want host order not network */
net = tvb_get_ntohs(tvb, ofs+2);
@@ -1124,9 +1122,9 @@ dissect_asp_reply_get_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
net, node, port);
break;
case 5: /* IP + port ssh tunnel */
- ip = tvb_get_ptr(tvb, ofs+2, 4);
port = tvb_get_ntohs(tvb, ofs+6);
- ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip (ssh tunnel) %s:%u",ip_to_str(ip),port);
+ ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip (ssh tunnel) %s:%u",
+ tvb_ip_to_str(tvb, ofs+2), port);
break;
case 4: /* DNS */
if (len > 2) {