aboutsummaryrefslogtreecommitdiffstats
path: root/epan/emem.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/emem.c')
-rw-r--r--epan/emem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/emem.c b/epan/emem.c
index a715ffe91a..855e0ac2a4 100644
--- a/epan/emem.c
+++ b/epan/emem.c
@@ -1723,8 +1723,10 @@ ep_strbuf_new(const gchar *init) {
emem_strbuf_t *strbuf;
strbuf = ep_strbuf_sized_new(next_size(0, init?strlen(init):0, 0), 0);
-
- g_strlcpy(strbuf->str, init, strbuf->alloc_len);
+ if (init)
+ g_strlcpy(strbuf->str, init, strbuf->alloc_len);
+ else
+ g_strlcpy(strbuf->str, "", strbuf->alloc_len);
return strbuf;
}