summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2011-04-26 21:23:56 +0200
committerLennart Poettering <lennart@poettering.net>2011-04-26 21:24:31 +0200
commitaa4355f295c76704baec08509e80fcb827c023da (patch)
treea8bbfc24cf00da63780d469bc71275349817af34
parent016e9849e03c1375a09c11c54ad06a61f6a24473 (diff)
strv: Fix gcc unitialized variable warning
Since strv_* functions handle null arguments, this warning is actually valid. src/strv.c: In function ‘strv_copy’: src/strv.c:68:21: warning: ‘k’ may be used uninitialized in this function [-Wuninitialized]
-rw-r--r--src/strv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/strv.c b/src/strv.c
index 71b77c9bbf..f15aa8736a 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;