From 710cf8121d502262609ef5fd69b1e4265a7a772b Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Wed, 14 Mar 2018 21:14:47 +0100 Subject: Nano: do not use packet scope strings in columns Bug: 14533 Change-Id: I2fcab070ca0da5a594f62bd61bd09e42e4113852 Reviewed-on: https://code.wireshark.org/review/26477 Reviewed-by: Pascal Quantin Petri-Dish: Pascal Quantin Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- epan/dissectors/packet-nano.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'epan/dissectors/packet-nano.c') diff --git a/epan/dissectors/packet-nano.c b/epan/dissectors/packet-nano.c index 9692ef1104..2a069dd988 100644 --- a/epan/dissectors/packet-nano.c +++ b/epan/dissectors/packet-nano.c @@ -150,7 +150,7 @@ static int dissect_nano_keepalive(tvbuff_t *tvb, packet_info *pinfo, proto_tree } } - col_set_str(pinfo->cinfo, COL_INFO, wmem_strdup_printf(wmem_packet_scope(), "Keepalive (%d peer%s)", peers, plurality(peers, "", "s"))); + col_add_fstr(pinfo->cinfo, COL_INFO, "Keepalive (%d peer%s)", peers, plurality(peers, "", "s")); return offset; } @@ -314,10 +314,9 @@ static int dissect_nano(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi // set the INFO header with more information nano_block_type = (guint)((extensions >> 8) & 0xF); - col_set_str(pinfo->cinfo, COL_INFO, - wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", - val_to_str(nano_packet_type, VALS(nano_packet_type_strings), " "), - val_to_str(nano_block_type, VALS(nano_block_type_strings), "Unknown (%d)"))); + col_add_fstr(pinfo->cinfo, COL_INFO, "%s (%s)", + val_to_str_const(nano_packet_type, VALS(nano_packet_type_strings), " "), + val_to_str(nano_block_type, VALS(nano_block_type_strings), "Unknown (%d)")); // if it's a Confirm Ack packet, we first have a vote if (nano_packet_type == NANO_PACKET_TYPE_CONFIRM_ACK) { @@ -342,7 +341,7 @@ static int dissect_nano(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi break; default: - col_set_str(pinfo->cinfo, COL_INFO, + col_add_str(pinfo->cinfo, COL_INFO, val_to_str(nano_packet_type, VALS(nano_packet_type_strings), "Unknown (%d)")); } -- cgit v1.2.3