diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-11-05 19:44:01 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-11-05 19:46:07 +0100 |
commit | 4a6ca457eb6186addcd84a6a5e5948016202235a (patch) | |
tree | b27be14b0320a389b580a42c3a2619b5d6edc3d4 | |
parent | condition: rewrite condition_test_kernel_command_line() based on unquote_firs... (diff) | |
download | systemd-4a6ca457eb6186addcd84a6a5e5948016202235a.tar.xz systemd-4a6ca457eb6186addcd84a6a5e5948016202235a.zip |
util: minor modernisations
-rw-r--r-- | src/shared/util.c | 9 |
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); |