X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fbasic%2Fstrv.c;fp=src%2Fbasic%2Fstrv.c;h=3a021003fae8b2e22c4e25a0a94411d8b819156b;hp=5c8261d9210d240e767c9c0af831c1dec106a2d9;hb=6766baac570c65a49f0eed23f181af1cab52b37f;hpb=f392163119aa4b0e9680db2d61ae41374b465d46 diff --git a/src/basic/strv.c b/src/basic/strv.c index 5c8261d92..3a021003f 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -375,7 +375,7 @@ char *strv_join(char **l, const char *separator) { n = 0; STRV_FOREACH(s, l) { - if (n != 0) + if (s != l) n += k; n += strlen(*s); } @@ -386,7 +386,7 @@ char *strv_join(char **l, const char *separator) { e = r; STRV_FOREACH(s, l) { - if (e != r) + if (s != l) e = stpcpy(e, separator); e = stpcpy(e, *s);