From cfe974aadd33da87e3f94c1226ab6de0f847d920 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 5 May 2009 19:33:46 +0000 Subject: The expert_item pointers and expert_status values don't need to be static; make them auto variables. Make sure that expert information is added outside "if (tree) { }", so it gets added even if we're not building the protocol tree. Clean up white space. svn path=/trunk/; revision=28281 --- epan/dissectors/packet-ncp2222.inc | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'epan/dissectors/packet-ncp2222.inc') diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc index 7f8ce5bfc3..489a16073f 100644 --- a/epan/dissectors/packet-ncp2222.inc +++ b/epan/dissectors/packet-ncp2222.inc @@ -4735,6 +4735,7 @@ dissect_nds_iterator(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, gui nds_val values; proto_tree *it_subtree, *it_subtree1; proto_item *it_subitem, *it_subitem1; + proto_item *expert_item; values.vtype = 0; values.vvalue = 0; @@ -8320,6 +8321,7 @@ dissect_nds_reply(tvbuff_t *tvb, packet_info *pinfo, guint32 nds_offset; guint32 nds_reply_buffer; guint32 nds_frag; + proto_item *expert_item; const char *verb_string; nds_val pvalues[9]; gboolean resolve_eid=FALSE; @@ -9010,6 +9012,9 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo, guint32 nds_reply_buffer = 0; const char *nds_error_string = NULL; guint32 nds_frag=0; + proto_item *expert_item; + guint8 conn_stat; + #ifdef FAKE_TREE_IS_VISIBLE if (ncp_tree) { @@ -9181,25 +9186,21 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo, completion_code, error_string); } - if (ncp_tree) { - guint8 conn_stat; - - conn_stat = tvb_get_guint8(tvb, 7); - expert_item = proto_tree_add_item(ncp_tree, hf_ncp_connection_status, tvb, - 7, 1, FALSE); - if (conn_stat != 0 && conn_stat != 0x40 ) { - if (check_col(pinfo->cinfo, COL_INFO)) { - col_set_str(pinfo->cinfo, COL_INFO, - "Error: Bad Connection Status"); - } - if (ncp_echo_err) { - expert_add_info_format(pinfo, expert_item, - PI_RESPONSE_CODE, PI_ERROR, - "Error: Bad Connection Status"); - } - return; + conn_stat = tvb_get_guint8(tvb, 7); + expert_item = proto_tree_add_item(ncp_tree, hf_ncp_connection_status, tvb, + 7, 1, FALSE); + if (conn_stat != 0 && conn_stat != 0x40 ) { + if (check_col(pinfo->cinfo, COL_INFO)) { + col_set_str(pinfo->cinfo, COL_INFO, + "Error: Bad Connection Status"); } - } + if (ncp_echo_err) { + expert_add_info_format(pinfo, expert_item, + PI_RESPONSE_CODE, PI_ERROR, + "Error: Bad Connection Status"); + } + return; + } /* * Unless this is a successful reply, that's all there * is to parse. -- cgit v1.2.3