util: minor modernisations

This commit is contained in:
Lennart Poettering
2014-11-05 19:46:07 +01:00
parent 07318c2908
commit 4a6ca457eb
+6 -3
View 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);