diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-01-12 03:19:07 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-01-12 03:19:07 +0000 |
commit | fd0e521cbb453015cf1b0022b4138597c038c3cf (patch) | |
tree | f7eb33402e68f9e10e1c4c4b03fe9ebe7507d044 /epan/dissectors/packet-dcerpc-fileexp.c | |
parent | 848f0670176398216bbac1201cbc05623bc3e698 (diff) |
There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_string(): just use proto_tree_add_item().
Replace some tvb_get_ptr()s with tvb_get_ephemeral_string()s.
In a couple of places an hf variable was being used as the length in a call to
proto_tree_add_*(). Use the appropriate variable instead.
svn path=/trunk/; revision=35495
Diffstat (limited to 'epan/dissectors/packet-dcerpc-fileexp.c')
-rw-r--r-- | epan/dissectors/packet-dcerpc-fileexp.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/epan/dissectors/packet-dcerpc-fileexp.c b/epan/dissectors/packet-dcerpc-fileexp.c index 01330dc824..cd31317ad3 100644 --- a/epan/dissectors/packet-dcerpc-fileexp.c +++ b/epan/dissectors/packet-dcerpc-fileexp.c @@ -603,10 +603,8 @@ typedef [string] byte NameString_t[AFS_NAMEMAX]; col_append_fstr (pinfo->cinfo, COL_INFO, " String_size:%u", string_size); if (string_size < AFS_NAMEMAX) { -/* proto_tree_add_string(tree, id, tvb, start, length, value_ptr); */ - - proto_tree_add_string (tree, hf_fileexp_afsNameString_t_principalName_string, tvb, offset, string_size, tvb_get_ptr (tvb, offset, string_size)); - namestring = tvb_get_ptr (tvb, offset, string_size); + proto_tree_add_item (tree, hf_fileexp_afsNameString_t_principalName_string, tvb, offset, string_size, ENC_NA); + namestring = tvb_get_ephemeral_string (tvb, offset, string_size); offset += string_size; if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", namestring); @@ -793,11 +791,9 @@ dissect_afsTaggedPath (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint16 (tvb, offset, pinfo, tree, drep, hf_fileexp_afsTaggedPath_tp_length, &tp_length); - proto_tree_add_string (tree, hf_fileexp_afsTaggedPath_tp_chars, tvb, offset, - hf_fileexp_afsTaggedPath_tp_length, tvb_get_ptr (tvb, - offset, - tp_length)); - tp_chars = tvb_get_ptr (tvb, offset, 1025); + proto_tree_add_item (tree, hf_fileexp_afsTaggedPath_tp_chars, tvb, offset, + tp_length, ENC_NA); + tp_chars = tvb_get_ephemeral_string (tvb, offset, 1025); offset += 1025; if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " :tp_chars %s", tp_chars); @@ -1375,10 +1371,9 @@ dissect_afstaggedname (tvbuff_t * tvb, int offset, &tn_length); if (tn_length < 254) { - proto_tree_add_string (tree, hf_fileexp_tn_string, tvb, offset, - hf_fileexp_tn_size, tvb_get_ptr (tvb, offset, - tn_length)); - tn_string = tvb_get_ptr (tvb, offset, 257); + proto_tree_add_item (tree, hf_fileexp_tn_string, tvb, offset, + tn_length, ENC_NA); + tn_string = tvb_get_ephemeral_string (tvb, offset, 257); offset += 257; if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " :tn_tag: %s", tn_string); |