From: Zbigniew Jędrzejewski-Szmek Date: Sat, 9 Apr 2016 18:04:09 +0000 (-0400) Subject: tree-wide: remove useless NULLs from strjoina X-Git-Tag: v231.3~197 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c3493a44f55e1c807b2b772403c02880d4cb1b16;p=elogind.git tree-wide: remove useless NULLs from strjoina The coccinelle patch didn't work in some places, I have no idea why. --- diff --git a/coccinelle/strjoina.cocci b/coccinelle/strjoina.cocci new file mode 100644 index 000000000..a6236eb0f --- /dev/null +++ b/coccinelle/strjoina.cocci @@ -0,0 +1,6 @@ +@@ +expression n, m; +expression list s; +@@ +- n = strjoina(m, s, NULL); ++ n = strjoina(m, s); diff --git a/src/login/logind-session.c b/src/login/logind-session.c index ff2c95c55..e615ccd31 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -520,7 +520,7 @@ static int session_start_scope(Session *s) { if (!scope) return log_oom(); - description = strjoina("Session ", s->id, " of user ", s->user->name, NULL); + description = strjoina("Session ", s->id, " of user ", s->user->name); r = manager_start_scope( s->manager, diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 94872a31c..c8092e0e5 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -2053,8 +2053,8 @@ static void log_job_error_with_service_result(const char* service, const char *r _cleanup_free_ char *t; t = strv_join((char**) extra_args, " "); - systemctl = strjoina("systemctl ", t ?: "", NULL); - journalctl = strjoina("journalctl ", t ?: "", NULL); + systemctl = strjoina("systemctl ", t ? : ""); + journalctl = strjoina("journalctl ", t ? : ""); } if (!isempty(result)) {