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 <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
This commit is contained in:
parent
14bc6d88b1
commit
57b72275b7
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue