summaryrefslogtreecommitdiff
path: root/src/strv.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-09-23 01:44:36 +0200
committerLennart Poettering <lennart@poettering.net>2011-09-23 01:45:34 +0200
commitf8440af5febb18ddfd2bc7a94b771284f0b7b310 (patch)
tree83172e88ffe4251d3fe7765a1f5874e1a5135f1a /src/strv.c
parent8ea913b2eaadbd92e069ea6b71cc5f5df409decf (diff)
coverity: change a few things so that coverity doesn't show so many false positives
Diffstat (limited to 'src/strv.c')
-rw-r--r--src/strv.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/strv.c b/src/strv.c
index 640ae3f0a..bb309d9f9 100644
--- a/src/strv.c
+++ b/src/strv.c
@@ -67,7 +67,8 @@ void strv_free(char **l) {
char **strv_copy(char **l) {
char **r, **k;
- if (!(k = r = new(char*, strv_length(l)+1)))
+ k = r = new(char*, strv_length(l)+1);
+ if (!k)
return NULL;
if (l)
@@ -198,7 +199,8 @@ char **strv_merge_concat(char **a, char **b, const char *suffix) {
if (!b)
return strv_copy(a);
- if (!(r = new(char*, strv_length(a)+strv_length(b)+1)))
+ r = new(char*, strv_length(a) + strv_length(b) + 1);
+ if (!r)
return NULL;
k = r;
@@ -324,7 +326,8 @@ char **strv_append(char **l, const char *s) {
if (!s)
return strv_copy(l);
- if (!(r = new(char*, strv_length(l)+2)))
+ r = new(char*, strv_length(l)+2);
+ if (!r)
return NULL;
for (k = r; *l; k++, l++)