X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fstrv.c;h=f15aa8736a0339a241245f01c71845f93d24d7a5;hp=71b77c9bbf97d857cce44ac0af1c350463d3ff50;hb=8fef76590052b235eec789f1acd24a0d1acbdaef;hpb=7640a5de1b3ffe6547200ad204d14e4f067caf4f diff --git a/src/strv.c b/src/strv.c index 71b77c9bb..f15aa8736 100644 --- a/src/strv.c +++ b/src/strv.c @@ -67,11 +67,11 @@ void strv_free(char **l) { char **strv_copy(char **l) { char **r, **k; - if (!(r = new(char*, strv_length(l)+1))) + if (!(k = r = new(char*, strv_length(l)+1))) return NULL; if (l) - for (k = r; *l; k++, l++) + for (; *l; k++, l++) if (!(*k = strdup(*l))) goto fail;