chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
016e984
)
strv: Fix gcc unitialized variable warning
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Tue, 26 Apr 2011 19:23:56 +0000
(21:23 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 26 Apr 2011 19:24:31 +0000
(21:24 +0200)
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]
src/strv.c
patch
|
blob
|
history
diff --git
a/src/strv.c
b/src/strv.c
index 71b77c9bbf97d857cce44ac0af1c350463d3ff50..f15aa8736a0339a241245f01c71845f93d24d7a5 100644
(file)
--- 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;