aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2022-11-25 18:32:41 +0000
committerJoão Valverde <j@v6e.pt>2022-11-30 15:55:54 +0000
commit729ea56b46b1c9faca58108b26723d1ddc986a1b (patch)
tree862e68ac169b10e78e54b2d937651456e8c7f313 /wsutil
parent93814ef7407611b55acc6f077539293ad0a44013 (diff)
wmem: Remove wmem_strbuf_new_label()
Only dissectors are using this function and there is no use case, as far as I know, that requires its use. Any limitation of length is imposed transparently by the UI backend. This function is problematic because it is not Unicode aware and will truncate a string on an arbitrary byte boundary for multibyte strings. Replace its use with a normal strbuf without a length limite and remove the function because it is not useful and the ITEM_LABEL_LENGTH parameter does not belong in wmem anyway.
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/wmem/wmem_strbuf.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/wsutil/wmem/wmem_strbuf.h b/wsutil/wmem/wmem_strbuf.h
index bc52026986..f063b4b341 100644
--- a/wsutil/wmem/wmem_strbuf.h
+++ b/wsutil/wmem/wmem_strbuf.h
@@ -58,14 +58,14 @@ wmem_strbuf_sized_new(wmem_allocator_t *allocator,
size_t alloc_size, size_t max_size)
G_GNUC_MALLOC;
-#define wmem_strbuf_new_label(ALLOCATOR) \
- wmem_strbuf_sized_new((ALLOCATOR), 0, ITEM_LABEL_LENGTH)
-
WS_DLL_PUBLIC
wmem_strbuf_t *
wmem_strbuf_new(wmem_allocator_t *allocator, const gchar *str)
G_GNUC_MALLOC;
+#define wmem_strbuf_create(allocator) \
+ wmem_strbuf_new(allocator, "")
+
WS_DLL_PUBLIC
wmem_strbuf_t *
wmem_strbuf_new_len(wmem_allocator_t *allocator, const gchar *str, size_t len)