diff options
author | Guy Harris <guy@alum.mit.edu> | 2009-01-26 22:58:47 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2009-01-26 22:58:47 +0000 |
commit | 248db0a42ae0e3563fdb8d26ae35f43b8aad9d75 (patch) | |
tree | 5590802a1458479288dda89c6cf58927f26b42be /plugins/profinet | |
parent | 4725b0a0f01da1163a3d64b1b427b735bcdd9ecd (diff) |
Non-constant strings should not be used as format items; the format
should be "%s", with the string used as an argument, just in case the
string contains a "%" character.
Clean up indentation.
svn path=/trunk/; revision=27304
Diffstat (limited to 'plugins/profinet')
-rw-r--r-- | plugins/profinet/packet-pn-dcp.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/plugins/profinet/packet-pn-dcp.c b/plugins/profinet/packet-pn-dcp.c index 5c64acc922..9f724bbb01 100644 --- a/plugins/profinet/packet-pn-dcp.c +++ b/plugins/profinet/packet-pn-dcp.c @@ -649,14 +649,15 @@ dissect_PNDCP_Suboption_Control(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_item_append_text(block_item, "Control/Response"); offset = dissect_PNDCP_Option(tvb, offset, pinfo, tree, block_item, hf_pn_dcp_suboption_control_response, FALSE /* append_col */); - block_error = tvb_get_guint8 (tvb, offset); - if (tree) { - item = proto_tree_add_uint(tree, hf_pn_dcp_block_error, tvb, offset, 1, block_error); - } - offset += 1; - if(block_error != 0) { - expert_add_info_format(pinfo, item, PI_RESPONSE_CODE, PI_CHAT, val_to_str(block_error, pn_dcp_block_error, "Unknown")); - } + block_error = tvb_get_guint8 (tvb, offset); + if (tree) { + item = proto_tree_add_uint(tree, hf_pn_dcp_block_error, tvb, offset, 1, block_error); + } + offset += 1; + if(block_error != 0) { + expert_add_info_format(pinfo, item, PI_RESPONSE_CODE, PI_CHAT, + "%s", val_to_str(block_error, pn_dcp_block_error, "Unknown")); + } info_str = ep_strdup_printf(", Response(%s)", val_to_str(block_error, pn_dcp_block_error, "Unknown")); pn_append_info(pinfo, dcp_item, info_str); proto_item_append_text(block_item, ", BlockError: %s", val_to_str(block_error, pn_dcp_block_error, "Unknown")); |