From 22a61b042376903deada022e7585e0585aaa7d43 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 22 May 2005 02:00:31 +0000 Subject: * Rework some Browsing/Resolving stuff * Add AvahiDomainBrowser * fix avahi_strlist_to_string() with empty lists git-svn-id: file:///home/lennart/svn/public/avahi/trunk@83 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/strlst.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'avahi-core/strlst.c') diff --git a/avahi-core/strlst.c b/avahi-core/strlst.c index ef9fa3e..866618f 100644 --- a/avahi-core/strlst.c +++ b/avahi-core/strlst.c @@ -102,10 +102,10 @@ gchar* avahi_string_list_to_string(AvahiStringList *l) { if (n != l) s ++; - s += n->size+3; + s += n->size+2; } - t = e = g_new(gchar, s); + t = e = g_new(gchar, s+1); for (n = l; n; n = n->next) { if (n != l) @@ -116,10 +116,12 @@ gchar* avahi_string_list_to_string(AvahiStringList *l) { e[n->size] = 0; e = strchr(e, 0); *(e++) = '"'; + + g_assert(e); } l = string_list_reverse(l); - + *e = 0; return t; -- cgit