diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-01-16 20:51:21 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-01-16 20:51:21 +0000 |
commit | 8d32d2066a22a6e3b3970961af9fb9a2a64c2ae6 (patch) | |
tree | 420d5401a47ed145c8aba98c7891e5f098f86e19 /epan/dissectors/packet-sap.c | |
parent | c04dd5fda9af1d2fdac3eb2d16b7e6de757558a9 (diff) |
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() or
tvb_get_const_stringz().
Use tvb_memeql() & tvb_memcmp().
svn path=/trunk/; revision=35558
Diffstat (limited to 'epan/dissectors/packet-sap.c')
-rw-r--r-- | epan/dissectors/packet-sap.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/epan/dissectors/packet-sap.c b/epan/dissectors/packet-sap.c index 51f69204ce..3019f949b7 100644 --- a/epan/dissectors/packet-sap.c +++ b/epan/dissectors/packet-sap.c @@ -122,7 +122,6 @@ dissect_sap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint8 vers_flags; guint8 auth_len; guint16 tmp1; - const guint8 *addr; guint8 auth_flags; tvbuff_t *next_tvb; @@ -168,9 +167,8 @@ dissect_sap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_text(sap_tree, tvb, offset, 2, "Message Identifier Hash: 0x%x", tmp1); offset +=2; - addr = tvb_get_ptr(tvb, offset, addr_len); proto_tree_add_text(sap_tree, tvb, offset, addr_len, "Originating Source: %s", - (is_ipv6) ? ip6_to_str((const struct e_in6_addr*)addr) : ip_to_str(addr)); + (is_ipv6) ? tvb_ip6_to_str(tvb, offset) : tvb_ip_to_str(tvb, offset)); offset += addr_len; /* Authentication data lives in its own subtree */ @@ -264,7 +262,7 @@ dissect_sap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } proto_tree_add_text(sap_tree, tvb, offset, pt_len, "Payload type: %.*s", pt_string_len, - tvb_get_ptr(tvb, offset, pt_string_len)); + tvb_get_ephemeral_string(tvb, offset, pt_string_len)); offset += pt_len; } } |