chiark / gitweb /
strv: make sure empty string lists result in a valid empty string in strv_join()
authorLennart Poettering <lennart@poettering.net>
Sun, 14 Feb 2010 21:38:07 +0000 (22:38 +0100)
committerLennart Poettering <lennart@poettering.net>
Sun, 14 Feb 2010 21:38:07 +0000 (22:38 +0100)
strv.c

diff --git a/strv.c b/strv.c
index 25ea92c..4cea86e 100644 (file)
--- a/strv.c
+++ b/strv.c
@@ -281,6 +281,8 @@ char *strv_join(char **l, const char *separator) {
                 e = stpcpy(e, *s);
         }
 
+        *e = 0;
+
         return r;
 }