diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-01-24 09:20:54 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-01-24 09:20:54 +0000 |
commit | eb2d6593dca282de10e8dc13a5e2cde4523b800a (patch) | |
tree | 72ec8d9d161bf956703a8111d9457fca75745804 /packet-yhoo.c | |
parent | 6f334976e03a191e5270813a63f6d454df5cb48b (diff) |
Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls in
arguments to "proto_tree_add_text()", and to "proto_tree_add_XXX()" calls
that add FT_NONE or FT_PROTO items to the protocol tree, with -1.
Replace some calls to "tvb_length()" or "tvb_length_remaining()" with
calls to "tvb_reported_length()" and "tvb_reported_length_remaining()",
as those give the actual length of the data in the packet, not just the
data that happened to be captured.
svn path=/trunk/; revision=4605
Diffstat (limited to 'packet-yhoo.c')
-rw-r--r-- | packet-yhoo.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/packet-yhoo.c b/packet-yhoo.c index 758118298a..b440a1e44d 100644 --- a/packet-yhoo.c +++ b/packet-yhoo.c @@ -2,7 +2,7 @@ * Routines for yahoo messenger packet dissection * Copyright 1999, Nathan Neulinger <nneul@umr.edu> * - * $Id: packet-yhoo.c,v 1.21 2002/01/21 07:36:48 guy Exp $ + * $Id: packet-yhoo.c,v 1.22 2002/01/24 09:20:53 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -109,7 +109,6 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree *yhoo_tree, *ti; int offset = 0; - int length = 0; if (pinfo->srcport != TCP_PORT_YHOO && pinfo->destport != TCP_PORT_YHOO) { /* Not the Yahoo port - not a Yahoo Messenger packet. */ @@ -124,8 +123,6 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return FALSE; } - length = tvb_length(tvb); - if (memcmp(tvb_get_ptr(tvb, offset, 4), "YPNS", 4) != 0 && memcmp(tvb_get_ptr(tvb, offset, 4), "YHOO", 4) != 0) { /* Not a Yahoo Messenger packet. */ @@ -146,8 +143,8 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } if (tree) { - ti = proto_tree_add_item(tree, proto_yhoo, tvb, offset, - tvb_length_remaining(tvb, offset), FALSE); + ti = proto_tree_add_item(tree, proto_yhoo, tvb, offset, -1, + FALSE); yhoo_tree = proto_item_add_subtree(ti, ett_yhoo); proto_tree_add_item(yhoo_tree, hf_yhoo_version, tvb, @@ -187,7 +184,7 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 36; proto_tree_add_item(yhoo_tree, hf_yhoo_content, tvb, - offset, length-offset, TRUE); + offset, tvb_length_remaining(tvb, offset), TRUE); } return TRUE; |