summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/shared/util.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 0f44eb5afe..d33f349d81 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -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);