From: Lennart Poettering Date: Wed, 5 Nov 2014 18:44:01 +0000 (+0100) Subject: util: minor modernisations X-Git-Tag: v218~542 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=4a6ca457eb6186addcd84a6a5e5948016202235a;hp=07318c290884824dd19f41beefb46aeaaabab46c util: minor modernisations --- diff --git a/src/shared/util.c b/src/shared/util.c index 0f44eb5af..d33f349d8 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);