]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic: drop unnecessary strempty() call in replace_env
authorRay Strode <rstrode@redhat.com>
Tue, 9 Aug 2016 14:39:15 +0000 (10:39 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 20 Feb 2017 23:49:14 +0000 (18:49 -0500)
strempty() converts a NULL value to empty string, so
that it can be passed on to functions that don't support NULL.

replace_env calls strempty before passing its value on to strappend.

strappend supports NULL just fine, though, so this commit drops the
strempty call.

src/basic/env-util.c

index f9208d1475a5033518995fa64835737c7b73883b..86ac07e1b69b934743dc66fe4de34f21c55ee988 100644 (file)
@@ -563,7 +563,7 @@ char *replace_env(const char *format, char **env) {
                         if (*e == '}') {
                                 const char *t;
 
-                                t = strempty(strv_env_get_n(env, word+2, e-word-2));
+                                t = strv_env_get_n(env, word+2, e-word-2);
 
                                 k = strappend(r, t);
                                 if (!k)