The #if 0'ed out code was being used; #if 0'ing it out meant that some

items didn't get put into the protocol tree.  See, for example, the
4548-Bug4668.pcap capture in the Wireshark menagerie (and attached to
bug 4668).

Instead, replace the #if 0'ed out code with code that does what the
non-commented-out line of code did, but doesn't assign to the unused and
now non-existent pi variable.

Make the "hf_id != -1" case the first one, as that should be the
"normal" case.

svn path=/trunk/; revision=37908
This commit is contained in:
Guy Harris 2011-07-05 23:14:00 +00:00
parent 1c7349022d
commit 2ef2ecde9a
1 changed files with 9 additions and 7 deletions

View File

@ -821,16 +821,18 @@ gint parseField_Enum(tvbuff_t *tvb, proto_tree *tree, gint offset, DIS_ParserNod
enumStr = val_to_str(enumVal, enumStrings, "Unknown Enumeration (%d)");
if (dis_hf_id == -1) {
if (dis_hf_id != -1) {
#if 0
pi = proto_tree_add_item(tree, dis_hf_id, tvb, offset, numBytes, FALSE);
proto_item_set_text(pi, "%s = %s", parserNode.fieldLabel, enumStr);
#else
proto_tree_add_item(tree, dis_hf_id, tvb, offset, numBytes, FALSE);
#endif
}
else {
proto_tree_add_text(tree, tvb, offset, numBytes, "%s = %s",
parserNode.fieldLabel, enumStr);
}
#if 0
else {
pi = proto_tree_add_item(tree, dis_hf_id, tvb, offset, numBytes, FALSE);
proto_item_set_text(pi, "%s = %s", parserNode.fieldLabel, enumStr);
}
#endif
if (parserNode.outputVar != 0)
{