aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>2009-04-07 16:43:15 +0000
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>2009-04-07 16:43:15 +0000
commita751728ea2ffc189ce600d4056370d73883a9c34 (patch)
treecfece47dbd18438f16bce70064dbad4d21f782ed /epan
parentb27d992b11e7360bccb7fa8da5af474abb28368d (diff)
Another patch to sqelch warnings about asserts in g_strlcpy with NULL source pointer
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27985 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-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;
}