summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-05 19:44:01 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-05 19:46:07 +0100
commit4a6ca457eb6186addcd84a6a5e5948016202235a (patch)
treeb27be14b0320a389b580a42c3a2619b5d6edc3d4 /src
parent07318c290884824dd19f41beefb46aeaaabab46c (diff)
util: minor modernisations
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);