aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bthfp.c
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2022-09-28 10:02:17 +0100
committerA Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2022-09-28 22:13:32 +0000
commitb9820231070a113b804ebf0c3b4c3e424c98f2ee (patch)
tree909c42f7f3c592566937bd6040be575c619eec88 /epan/dissectors/packet-bthfp.c
parent15634c0b4690a27c81cf69d60f9d7016fc62c61f (diff)
epan: Use proto_*_ret_display_string() in a couple of places
Use a better pattern than formatting the string for display multiple times. Code is cleaner avoids wasteful calls to format_text() that can be slightly expensive. In some cases it might not have exactly the same whitespace semantics for the column info (escape vs replace) but that's OK.
Diffstat (limited to 'epan/dissectors/packet-bthfp.c')
-rw-r--r--epan/dissectors/packet-bthfp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dissectors/packet-bthfp.c b/epan/dissectors/packet-bthfp.c
index 09f4b6ef72..f9afb053d5 100644
--- a/epan/dissectors/packet-bthfp.c
+++ b/epan/dissectors/packet-bthfp.c
@@ -2438,12 +2438,11 @@ dissect_bthfp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
}
} else {
- col_append_fstr(pinfo->cinfo, COL_INFO, "Fragment: %s",
- tvb_format_text_wsp(wmem_packet_scope(), tvb, offset, tvb_captured_length_remaining(tvb, offset)));
pitem = proto_tree_add_item(main_tree, hf_fragmented, tvb, 0, 0, ENC_NA);
proto_item_set_generated(pitem);
- proto_tree_add_item(main_tree, hf_fragment, tvb, offset,
- tvb_captured_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
+ char *display_str;
+ proto_tree_add_item_ret_display_string(main_tree, hf_fragment, tvb, offset, -1, ENC_ASCII, pinfo->pool, &display_str);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "Fragment: %s", display_str);
offset = tvb_captured_length(tvb);
}