From 57b72275b7f5c5ef99208fbcf7aa6647451f4c4d Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Fri, 14 Nov 2014 15:13:05 -0500 Subject: [PATCH] Eliminate proto_tree_add_text by formatting field hf_opcua_ByteString in a few places. Change-Id: I9606aa36b7d7b6bb2ef2e7685e6629163ca83ef7 Reviewed-on: https://code.wireshark.org/review/5312 Reviewed-by: Michael Mann Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Evan Huus --- plugins/opcua/opcua_extensionobjecttable.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/opcua/opcua_extensionobjecttable.c b/plugins/opcua/opcua_extensionobjecttable.c index 9ca5960b62..c829d8b5e0 100644 --- a/plugins/opcua/opcua_extensionobjecttable.c +++ b/plugins/opcua/opcua_extensionobjecttable.c @@ -197,7 +197,7 @@ void dispatchExtensionObjectType(proto_tree *tree, tvbuff_t *tvb, packet_info *p { if (iLen == -1) { - proto_tree_add_text(tree, tvb, *pOffset, 4, "[OpcUa Null ByteString]"); + proto_tree_add_bytes_format_value(tree, hf_opcua_ByteString, tvb, *pOffset, 4, NULL, "[OpcUa Null ByteString]"); } else if (iLen >= 0) { @@ -206,8 +206,7 @@ void dispatchExtensionObjectType(proto_tree *tree, tvbuff_t *tvb, packet_info *p } else { - char *szValue = wmem_strdup_printf(wmem_packet_scope(), "[Invalid ByteString] Invalid length: %d", iLen); - proto_tree_add_text(tree, tvb, *pOffset, 4, "%s", szValue); + proto_tree_add_bytes_format_value(tree, hf_opcua_ByteString, tvb, *pOffset, 4, NULL, "[Invalid ByteString] Invalid length: %d", iLen); } }