chiark / gitweb /
util: minor modernisations
authorLennart Poettering <lennart@poettering.net>
Wed, 5 Nov 2014 18:44:01 +0000 (19:44 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 5 Nov 2014 18:46:07 +0000 (19:46 +0100)
src/shared/util.c

index 0f44eb5..d33f349 100644 (file)
@@ -3179,7 +3179,8 @@ char *replace_env(const char *format, char **env) {
 
                 case CURLY:
                         if (*e == '{') {
-                                if (!(k = strnappend(r, word, e-word-1)))
+                                k = strnappend(r, word, e-word-1);
+                                if (!k)
                                         goto fail;
 
                                 free(r);
@@ -3189,7 +3190,8 @@ char *replace_env(const char *format, char **env) {
                                 state = VARIABLE;
 
                         } else if (*e == '$') {
-                                if (!(k = strnappend(r, word, e-word)))
+                                k = strnappend(r, word, e-word);
+                                if (!k)
                                         goto fail;
 
                                 free(r);
@@ -3221,7 +3223,8 @@ char *replace_env(const char *format, char **env) {
                 }
         }
 
-        if (!(k = strnappend(r, word, e-word)))
+        k = strnappend(r, word, e-word);
+        if (!k)
                 goto fail;
 
         free(r);