blob: 72bea3af7d891cfdc166c2eb91cd13b1e1a7d7f9 [file] [log] [blame]
Zbigniew Jędrzejewski-Szmek5d6eedd2017-01-31 12:11:17 -05001From 3fe7a210f1277a61b1281c91684103c730234429 Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek03e93e22017-01-29 17:22:41 -05002From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
3Date: Sun, 23 Oct 2016 11:43:27 -0400
4Subject: [PATCH] tree-wide: drop NULL sentinel from strjoin
5
6This makes strjoin and strjoina more similar and avoids the useless final
7argument.
8
9spatch -I . -I ./src -I ./src/basic -I ./src/basic -I ./src/shared -I ./src/shared -I ./src/network -I ./src/locale -I ./src/login -I ./src/journal -I ./src/journal -I ./src/timedate -I ./src/timesync -I ./src/nspawn -I ./src/resolve -I ./src/resolve -I ./src/systemd -I ./src/core -I ./src/core -I ./src/libudev -I ./src/udev -I ./src/udev/net -I ./src/udev -I ./src/libsystemd/sd-bus -I ./src/libsystemd/sd-event -I ./src/libsystemd/sd-login -I ./src/libsystemd/sd-netlink -I ./src/libsystemd/sd-network -I ./src/libsystemd/sd-hwdb -I ./src/libsystemd/sd-device -I ./src/libsystemd/sd-id128 -I ./src/libsystemd-network --sp-file coccinelle/strjoin.cocci --in-place $(git ls-files src/*.c)
10
11git grep -e '\bstrjoin\b.*NULL' -l|xargs sed -i -r 's/strjoin\((.*), NULL\)/strjoin(\1)/'
12
13This might have missed a few cases (spatch has a really hard time dealing
14with _cleanup_ macros), but that's no big issue, they can always be fixed
15later.
16
17(cherry picked from commit 605405c6cc934466951b0c6bad5a9553620bcb08)
18---
19 coccinelle/strjoin.cocci | 16 +++++++++++++++
20 src/backlight/backlight.c | 4 ++--
21 src/basic/btrfs-util.c | 2 +-
22 src/basic/cgroup-util.c | 16 +++++++--------
23 src/basic/conf-files.c | 2 +-
24 src/basic/fileio.c | 6 +++---
25 src/basic/fs-util.c | 2 +-
26 src/basic/mount-util.c | 2 +-
27 src/basic/path-util.c | 12 +++++-------
28 src/basic/process-util.c | 6 +++---
29 src/basic/string-util.c | 2 +-
30 src/basic/string-util.h | 3 ++-
31 src/basic/unit-name.c | 4 ++--
32 src/basic/util.c | 2 +-
33 src/cgls/cgls.c | 2 +-
34 src/cgtop/cgtop.c | 2 +-
35 src/core/cgroup.c | 7 ++++---
36 src/core/dbus-execute.c | 2 +-
37 src/core/dbus-unit.c | 6 +++---
38 src/core/device.c | 2 +-
39 src/core/execute.c | 10 +++++-----
40 src/core/locale-setup.c | 2 +-
41 src/core/manager.c | 2 +-
42 src/core/namespace.c | 2 +-
43 src/core/service.c | 2 +-
44 src/core/timer.c | 4 ++--
45 src/core/unit.c | 4 ++--
46 src/coredump/coredump.c | 9 +++++++--
47 src/coredump/coredumpctl.c | 4 ++--
48 src/cryptsetup/cryptsetup-generator.c | 12 ++++++------
49 src/debug-generator/debug-generator.c | 4 ++--
50 src/delta/delta.c | 8 ++++----
51 src/escape/escape.c | 2 +-
52 src/fstab-generator/fstab-generator.c | 14 ++++++-------
53 src/gpt-auto-generator/gpt-auto-generator.c | 24 +++++++++++------------
54 src/hibernate-resume/hibernate-resume-generator.c | 2 +-
55 src/hostname/hostnamed.c | 2 +-
56 src/hwdb/hwdb.c | 2 +-
57 src/import/import-raw.c | 2 +-
58 src/import/import-tar.c | 2 +-
59 src/journal-remote/journal-gatewayd.c | 2 +-
60 src/journal-remote/journal-upload.c | 4 ++--
61 src/journal/journalctl.c | 2 +-
62 src/journal/journald-server.c | 6 +++---
63 src/journal/journald-wall.c | 2 +-
64 src/journal/sd-journal.c | 6 +++---
65 src/libsystemd/sd-bus/bus-kernel.c | 2 +-
66 src/libsystemd/sd-bus/busctl-introspect.c | 2 +-
67 src/libsystemd/sd-bus/busctl.c | 4 ++--
68 src/libsystemd/sd-bus/sd-bus.c | 6 +++---
69 src/libsystemd/sd-bus/test-bus-objects.c | 2 +-
70 src/libsystemd/sd-device/device-enumerator.c | 2 +-
71 src/libsystemd/sd-path/sd-path.c | 8 ++++----
72 src/locale/keymap-util.c | 6 +++---
73 src/login/logind-inhibit.c | 2 +-
74 src/login/logind-session.c | 2 +-
75 src/login/pam_systemd.c | 2 +-
76 src/machine/machine.c | 2 +-
77 src/mount/mount-tool.c | 4 ++--
78 src/nspawn/nspawn-mount.c | 4 ++--
79 src/nspawn/nspawn.c | 4 ++--
80 src/rc-local-generator/rc-local-generator.c | 4 ++--
81 src/resolve/resolved-dns-dnssec.c | 2 +-
82 src/resolve/resolved-dns-rr.c | 14 ++++++-------
83 src/resolve/test-dnssec-complex.c | 2 +-
84 src/rfkill/rfkill.c | 4 ++--
85 src/run/run.c | 2 +-
86 src/shared/base-filesystem.c | 2 +-
87 src/shared/bus-util.c | 4 ++--
88 src/shared/cgroup-show.c | 2 +-
89 src/shared/conf-parser.c | 2 +-
90 src/shared/dns-domain.c | 4 ++--
91 src/shared/dropin.c | 10 +++++-----
92 src/shared/fstab-util.c | 2 +-
93 src/shared/install-printf.c | 2 +-
94 src/shared/install.c | 10 +++++-----
95 src/shared/machine-image.c | 2 +-
96 src/shared/path-lookup.c | 4 ++--
97 src/systemctl/systemctl.c | 10 +++++-----
98 src/sysv-generator/sysv-generator.c | 10 +++++-----
99 src/test/test-copy.c | 4 ++--
100 src/test/test-date.c | 4 ++--
101 src/test/test-fileio.c | 2 +-
102 src/test/test-namespace.c | 8 ++++----
103 src/test/test-path.c | 2 +-
104 src/test/test-replace-var.c | 2 +-
105 src/tmpfiles/tmpfiles.c | 4 ++--
106 src/udev/udev-builtin-hwdb.c | 2 +-
107 src/udev/udevadm-hwdb.c | 2 +-
108 89 files changed, 215 insertions(+), 194 deletions(-)
109 create mode 100644 coccinelle/strjoin.cocci
110
111diff --git a/coccinelle/strjoin.cocci b/coccinelle/strjoin.cocci
112new file mode 100644
113index 0000000000..675760e37a
114--- /dev/null
115+++ b/coccinelle/strjoin.cocci
116@@ -0,0 +1,16 @@
117+@@
118+expression list args;
119+@@
120+- strjoin(args, NULL);
121++ strjoin(args);
122+@@
123+expression t;
124+expression list args;
125+@@
126+- t = strjoin(args, NULL);
127++ t = strjoin(args);
128+@@
129+expression list args;
130+@@
131+- return strjoin(args, NULL);
132++ return strjoin(args);
133diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
134index 7c59f60d5f..c909b5bb51 100644
135--- a/src/backlight/backlight.c
136+++ b/src/backlight/backlight.c
137@@ -357,9 +357,9 @@ int main(int argc, char *argv[]) {
138 return EXIT_FAILURE;
139 }
140
141- saved = strjoin("/var/lib/systemd/backlight/", escaped_path_id, ":", escaped_ss, ":", escaped_sysname, NULL);
142+ saved = strjoin("/var/lib/systemd/backlight/", escaped_path_id, ":", escaped_ss, ":", escaped_sysname);
143 } else
144- saved = strjoin("/var/lib/systemd/backlight/", escaped_ss, ":", escaped_sysname, NULL);
145+ saved = strjoin("/var/lib/systemd/backlight/", escaped_ss, ":", escaped_sysname);
146
147 if (!saved) {
148 log_oom();
149diff --git a/src/basic/btrfs-util.c b/src/basic/btrfs-util.c
150index 359d85f2e8..656bb13719 100644
151--- a/src/basic/btrfs-util.c
152+++ b/src/basic/btrfs-util.c
153@@ -1642,7 +1642,7 @@ static int subvol_snapshot_children(int old_fd, int new_fd, const char *subvolum
154 if (old_child_fd < 0)
155 return -errno;
156
157- np = strjoin(subvolume, "/", ino_args.name, NULL);
158+ np = strjoin(subvolume, "/", ino_args.name);
159 if (!np)
160 return -ENOMEM;
161
162diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
163index 134e6e3664..63c913f14d 100644
164--- a/src/basic/cgroup-util.c
165+++ b/src/basic/cgroup-util.c
166@@ -345,7 +345,7 @@ int cg_kill_recursive(
167 while ((r = cg_read_subgroup(d, &fn)) > 0) {
168 _cleanup_free_ char *p = NULL;
169
170- p = strjoin(path, "/", fn, NULL);
171+ p = strjoin(path, "/", fn);
172 free(fn);
173 if (!p)
174 return -ENOMEM;
175@@ -479,7 +479,7 @@ int cg_migrate_recursive(
176 while ((r = cg_read_subgroup(d, &fn)) > 0) {
177 _cleanup_free_ char *p = NULL;
178
179- p = strjoin(pfrom, "/", fn, NULL);
180+ p = strjoin(pfrom, "/", fn);
181 free(fn);
182 if (!p)
183 return -ENOMEM;
184@@ -562,11 +562,11 @@ static int join_path_legacy(const char *controller, const char *path, const char
185 if (isempty(path) && isempty(suffix))
186 t = strappend("/sys/fs/cgroup/", dn);
187 else if (isempty(path))
188- t = strjoin("/sys/fs/cgroup/", dn, "/", suffix, NULL);
189+ t = strjoin("/sys/fs/cgroup/", dn, "/", suffix);
190 else if (isempty(suffix))
191- t = strjoin("/sys/fs/cgroup/", dn, "/", path, NULL);
192+ t = strjoin("/sys/fs/cgroup/", dn, "/", path);
193 else
194- t = strjoin("/sys/fs/cgroup/", dn, "/", path, "/", suffix, NULL);
195+ t = strjoin("/sys/fs/cgroup/", dn, "/", path, "/", suffix);
196 if (!t)
197 return -ENOMEM;
198
199@@ -586,7 +586,7 @@ static int join_path_unified(const char *path, const char *suffix, char **fs) {
200 else if (isempty(suffix))
201 t = strappend("/sys/fs/cgroup/", path);
202 else
203- t = strjoin("/sys/fs/cgroup/", path, "/", suffix, NULL);
204+ t = strjoin("/sys/fs/cgroup/", path, "/", suffix);
205 if (!t)
206 return -ENOMEM;
207
208@@ -613,7 +613,7 @@ int cg_get_path(const char *controller, const char *path, const char *suffix, ch
209 else if (!path)
210 t = strdup(suffix);
211 else
212- t = strjoin(path, "/", suffix, NULL);
213+ t = strjoin(path, "/", suffix);
214 if (!t)
215 return -ENOMEM;
216
217@@ -1145,7 +1145,7 @@ int cg_is_empty_recursive(const char *controller, const char *path) {
218 while ((r = cg_read_subgroup(d, &fn)) > 0) {
219 _cleanup_free_ char *p = NULL;
220
221- p = strjoin(path, "/", fn, NULL);
222+ p = strjoin(path, "/", fn);
223 free(fn);
224 if (!p)
225 return -ENOMEM;
226diff --git a/src/basic/conf-files.c b/src/basic/conf-files.c
227index c781610e14..c0c22610d7 100644
228--- a/src/basic/conf-files.c
229+++ b/src/basic/conf-files.c
230@@ -60,7 +60,7 @@ static int files_add(Hashmap *h, const char *root, const char *path, const char
231 if (!dirent_is_file_with_suffix(de, suffix))
232 continue;
233
234- p = strjoin(dirpath, "/", de->d_name, NULL);
235+ p = strjoin(dirpath, "/", de->d_name);
236 if (!p)
237 return -ENOMEM;
238
239diff --git a/src/basic/fileio.c b/src/basic/fileio.c
240index 1cfb7a98f5..1615456659 100644
241--- a/src/basic/fileio.c
242+++ b/src/basic/fileio.c
243@@ -676,7 +676,7 @@ static int load_env_file_push(
244 return -EINVAL;
245 }
246
247- p = strjoin(key, "=", strempty(value), NULL);
248+ p = strjoin(key, "=", strempty(value));
249 if (!p)
250 return -ENOMEM;
251
252@@ -963,9 +963,9 @@ static int search_and_fopen_internal(const char *path, const char *mode, const c
253 FILE *f;
254
255 if (root)
256- p = strjoin(root, *i, "/", path, NULL);
257+ p = strjoin(root, *i, "/", path);
258 else
259- p = strjoin(*i, "/", path, NULL);
260+ p = strjoin(*i, "/", path);
261 if (!p)
262 return -ENOMEM;
263
264diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c
265index 48952a1c26..d2c322a0de 100644
266--- a/src/basic/fs-util.c
267+++ b/src/basic/fs-util.c
268@@ -742,7 +742,7 @@ int chase_symlinks(const char *path, const char *_root, char **ret) {
269 /* A relative destination. If so, this is what we'll prefix what's left to do with what
270 * we just read, and start the loop again, but remain in the current directory. */
271
272- joined = strjoin("/", destination, todo, NULL);
273+ joined = strjoin("/", destination, todo);
274 if (!joined)
275 return -ENOMEM;
276
277diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c
278index c8f8022578..5d37fb48be 100644
279--- a/src/basic/mount-util.c
280+++ b/src/basic/mount-util.c
281@@ -642,7 +642,7 @@ static char* mount_flags_to_string(long unsigned flags) {
282 FLAG(MS_I_VERSION),
283 FLAG(MS_STRICTATIME),
284 FLAG(MS_LAZYTIME),
285- y, NULL);
286+ y);
287 if (!x)
288 return NULL;
289 if (!y)
290diff --git a/src/basic/path-util.c b/src/basic/path-util.c
291index fd38f51c4c..5cdac50c68 100644
292--- a/src/basic/path-util.c
293+++ b/src/basic/path-util.c
294@@ -83,7 +83,7 @@ char *path_make_absolute(const char *p, const char *prefix) {
295 if (path_is_absolute(p) || !prefix)
296 return strdup(p);
297
298- return strjoin(prefix, "/", p, NULL);
299+ return strjoin(prefix, "/", p);
300 }
301
302 int path_make_absolute_cwd(const char *p, char **ret) {
303@@ -104,7 +104,7 @@ int path_make_absolute_cwd(const char *p, char **ret) {
304 if (!cwd)
305 return negative_errno();
306
307- c = strjoin(cwd, "/", p, NULL);
308+ c = strjoin(cwd, "/", p);
309 }
310 if (!c)
311 return -ENOMEM;
312@@ -454,13 +454,11 @@ char* path_join(const char *root, const char *path, const char *rest) {
313 return strjoin(root, endswith(root, "/") ? "" : "/",
314 path[0] == '/' ? path+1 : path,
315 rest ? (endswith(path, "/") ? "" : "/") : NULL,
316- rest && rest[0] == '/' ? rest+1 : rest,
317- NULL);
318+ rest && rest[0] == '/' ? rest+1 : rest);
319 else
320 return strjoin(path,
321 rest ? (endswith(path, "/") ? "" : "/") : NULL,
322- rest && rest[0] == '/' ? rest+1 : rest,
323- NULL);
324+ rest && rest[0] == '/' ? rest+1 : rest);
325 }
326
327 int find_binary(const char *name, char **ret) {
328@@ -504,7 +502,7 @@ int find_binary(const char *name, char **ret) {
329 if (!path_is_absolute(element))
330 continue;
331
332- j = strjoin(element, "/", name, NULL);
333+ j = strjoin(element, "/", name);
334 if (!j)
335 return -ENOMEM;
336
337diff --git a/src/basic/process-util.c b/src/basic/process-util.c
338index 54b644ad56..48a5c719af 100644
339--- a/src/basic/process-util.c
340+++ b/src/basic/process-util.c
341@@ -236,14 +236,14 @@ int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char *
342 return h;
343
344 if (max_length == 0)
345- r = strjoin("[", t, "]", NULL);
346+ r = strjoin("[", t, "]");
347 else {
348 size_t l;
349
350 l = strlen(t);
351
352 if (l + 3 <= max_length)
353- r = strjoin("[", t, "]", NULL);
354+ r = strjoin("[", t, "]");
355 else if (max_length <= 6) {
356
357 r = new(char, max_length);
358@@ -263,7 +263,7 @@ int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char *
359 e--;
360 *e = 0;
361
362- r = strjoin("[", t, "...]", NULL);
363+ r = strjoin("[", t, "...]");
364 }
365 }
366 if (!r)
367diff --git a/src/basic/string-util.c b/src/basic/string-util.c
368index 6b06e643c9..2ba3604ba0 100644
369--- a/src/basic/string-util.c
370+++ b/src/basic/string-util.c
371@@ -218,7 +218,7 @@ char *strappend(const char *s, const char *suffix) {
372 return strnappend(s, suffix, suffix ? strlen(suffix) : 0);
373 }
374
375-char *strjoin(const char *x, ...) {
376+char *strjoin_real(const char *x, ...) {
377 va_list ap;
378 size_t l;
379 char *r, *p;
380diff --git a/src/basic/string-util.h b/src/basic/string-util.h
381index d029d538bd..0175803302 100644
382--- a/src/basic/string-util.h
383+++ b/src/basic/string-util.h
384@@ -116,7 +116,8 @@ const char* split(const char **state, size_t *l, const char *separator, bool quo
385 char *strappend(const char *s, const char *suffix);
386 char *strnappend(const char *s, const char *suffix, size_t length);
387
388-char *strjoin(const char *x, ...) _sentinel_;
389+char *strjoin_real(const char *x, ...) _sentinel_;
390+#define strjoin(a, ...) strjoin_real((a), __VA_ARGS__, NULL)
391
392 #define strjoina(a, ...) \
393 ({ \
394diff --git a/src/basic/unit-name.c b/src/basic/unit-name.c
395index fe883b95c7..0a6efa449a 100644
396--- a/src/basic/unit-name.c
397+++ b/src/basic/unit-name.c
398@@ -273,7 +273,7 @@ int unit_name_build(const char *prefix, const char *instance, const char *suffix
399 if (!instance)
400 s = strappend(prefix, suffix);
401 else
402- s = strjoin(prefix, "@", instance, suffix, NULL);
403+ s = strjoin(prefix, "@", instance, suffix);
404 if (!s)
405 return -ENOMEM;
406
407@@ -554,7 +554,7 @@ int unit_name_from_path_instance(const char *prefix, const char *path, const cha
408 if (r < 0)
409 return r;
410
411- s = strjoin(prefix, "@", p, suffix, NULL);
412+ s = strjoin(prefix, "@", p, suffix);
413 if (!s)
414 return -ENOMEM;
415
416diff --git a/src/basic/util.c b/src/basic/util.c
417index ec7939dc83..0f65e4839c 100644
418--- a/src/basic/util.c
419+++ b/src/basic/util.c
420@@ -131,7 +131,7 @@ static int do_execute(char **directories, usec_t timeout, char *argv[]) {
421 if (r < 0)
422 return log_oom();
423
424- path = strjoin(*directory, "/", de->d_name, NULL);
425+ path = strjoin(*directory, "/", de->d_name);
426 if (!path)
427 return log_oom();
428
429diff --git a/src/cgls/cgls.c b/src/cgls/cgls.c
430index adf488e8e1..b55aa86a40 100644
431--- a/src/cgls/cgls.c
432+++ b/src/cgls/cgls.c
433@@ -223,7 +223,7 @@ int main(int argc, char *argv[]) {
434
435 controller = c ?: SYSTEMD_CGROUP_CONTROLLER;
436 if (p) {
437- j = strjoin(root, "/", p, NULL);
438+ j = strjoin(root, "/", p);
439 if (!j) {
440 r = log_oom();
441 goto finish;
442diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
443index aba17c9829..af5c3d8695 100644
444--- a/src/cgtop/cgtop.c
445+++ b/src/cgtop/cgtop.c
446@@ -431,7 +431,7 @@ static int refresh_one(
447 if (r == 0)
448 break;
449
450- p = strjoin(path, "/", fn, NULL);
451+ p = strjoin(path, "/", fn);
452 if (!p)
453 return -ENOMEM;
454
455diff --git a/src/core/cgroup.c b/src/core/cgroup.c
456index 23a92f9651..d662b21cb9 100644
457--- a/src/core/cgroup.c
458+++ b/src/core/cgroup.c
459@@ -1201,9 +1201,10 @@ char *unit_default_cgroup_path(Unit *u) {
460 return NULL;
461
462 if (slice)
463- return strjoin(u->manager->cgroup_root, "/", slice, "/", escaped, NULL);
464+ return strjoin(u->manager->cgroup_root, "/", slice, "/",
465+ escaped);
466 else
467- return strjoin(u->manager->cgroup_root, "/", escaped, NULL);
468+ return strjoin(u->manager->cgroup_root, "/", escaped);
469 }
470
471 int unit_set_cgroup_path(Unit *u, const char *path) {
472@@ -1643,7 +1644,7 @@ static int unit_watch_pids_in_path(Unit *u, const char *path) {
473 while ((r = cg_read_subgroup(d, &fn)) > 0) {
474 _cleanup_free_ char *p = NULL;
475
476- p = strjoin(path, "/", fn, NULL);
477+ p = strjoin(path, "/", fn);
478 free(fn);
479
480 if (!p)
481diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
482index 1a7f770db1..03f23780c1 100644
483--- a/src/core/dbus-execute.c
484+++ b/src/core/dbus-execute.c
485@@ -1368,7 +1368,7 @@ int bus_exec_context_set_transient_property(
486 if (mode != UNIT_CHECK) {
487 char *buf = NULL;
488
489- buf = strjoin(b ? "-" : "", path, NULL);
490+ buf = strjoin(b ? "-" : "", path);
491 if (!buf)
492 return -ENOMEM;
493
494diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
495index 69e249c844..b6cb6e1350 100644
496--- a/src/core/dbus-unit.c
497+++ b/src/core/dbus-unit.c
498@@ -481,7 +481,7 @@ int bus_unit_method_start_generic(
499 return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Job mode %s invalid", smode);
500
501 if (reload_if_possible)
502- verb = strjoin("reload-or-", job_type_to_string(job_type), NULL);
503+ verb = strjoin("reload-or-", job_type_to_string(job_type));
504 else
505 verb = strdup(job_type_to_string(job_type));
506 if (!verb)
507@@ -984,7 +984,7 @@ static int append_cgroup(sd_bus_message *reply, const char *p, Set *pids) {
508 if (r == 0)
509 break;
510
511- j = strjoin(p, "/", g, NULL);
512+ j = strjoin(p, "/", g);
513 if (!j)
514 return -ENOMEM;
515
516@@ -1363,7 +1363,7 @@ static int bus_unit_set_transient_property(
517 if (r < 0)
518 return r;
519
520- label = strjoin(name, "-", other, NULL);
521+ label = strjoin(name, "-", other);
522 if (!label)
523 return -ENOMEM;
524
525diff --git a/src/core/device.c b/src/core/device.c
526index 4b9e84aeb6..425779d74f 100644
527--- a/src/core/device.c
528+++ b/src/core/device.c
529@@ -239,7 +239,7 @@ static int device_update_description(Unit *u, struct udev_device *dev, const cha
530 if (label) {
531 _cleanup_free_ char *j;
532
533- j = strjoin(model, " ", label, NULL);
534+ j = strjoin(model, " ", label);
535 if (j)
536 r = unit_set_description(u, j);
537 else
538diff --git a/src/core/execute.c b/src/core/execute.c
539index 38cd486d82..224382b581 100644
540--- a/src/core/execute.c
541+++ b/src/core/execute.c
542@@ -1603,7 +1603,7 @@ static int build_environment(
543 if (!joined)
544 return -ENOMEM;
545
546- x = strjoin("LISTEN_FDNAMES=", joined, NULL);
547+ x = strjoin("LISTEN_FDNAMES=", joined);
548 if (!x)
549 return -ENOMEM;
550 our_env[n_env++] = x;
551@@ -1710,7 +1710,7 @@ static int build_pass_environment(const ExecContext *c, char ***ret) {
552 v = getenv(*i);
553 if (!v)
554 continue;
555- x = strjoin(*i, "=", v, NULL);
556+ x = strjoin(*i, "=", v);
557 if (!x)
558 return -ENOMEM;
559 if (!GREEDY_REALLOC(pass_env, n_bufsize, n_env + 2))
560@@ -1924,7 +1924,7 @@ static int setup_runtime_directory(
561 STRV_FOREACH(rt, context->runtime_directory) {
562 _cleanup_free_ char *p;
563
564- p = strjoin(params->runtime_prefix, "/", *rt, NULL);
565+ p = strjoin(params->runtime_prefix, "/", *rt);
566 if (!p)
567 return -ENOMEM;
568
569@@ -2000,7 +2000,7 @@ static int compile_read_write_paths(
570 STRV_FOREACH(rt, context->runtime_directory) {
571 char *s;
572
573- s = strjoin(params->runtime_prefix, "/", *rt, NULL);
574+ s = strjoin(params->runtime_prefix, "/", *rt);
575 if (!s)
576 return -ENOMEM;
577
578@@ -3004,7 +3004,7 @@ int exec_context_destroy_runtime_directory(ExecContext *c, const char *runtime_p
579 STRV_FOREACH(i, c->runtime_directory) {
580 _cleanup_free_ char *p;
581
582- p = strjoin(runtime_prefix, "/", *i, NULL);
583+ p = strjoin(runtime_prefix, "/", *i);
584 if (!p)
585 return -ENOMEM;
586
587diff --git a/src/core/locale-setup.c b/src/core/locale-setup.c
588index ccf61d29fb..fdd847ee8b 100644
589--- a/src/core/locale-setup.c
590+++ b/src/core/locale-setup.c
591@@ -87,7 +87,7 @@ int locale_setup(char ***environment) {
592 if (!variables[i])
593 continue;
594
595- s = strjoin(locale_variable_to_string(i), "=", variables[i], NULL);
596+ s = strjoin(locale_variable_to_string(i), "=", variables[i]);
597 if (!s) {
598 r = -ENOMEM;
599 goto finish;
600diff --git a/src/core/manager.c b/src/core/manager.c
601index 322e69a69c..e00e43a199 100644
602--- a/src/core/manager.c
603+++ b/src/core/manager.c
604@@ -1196,7 +1196,7 @@ static void manager_build_unit_path_cache(Manager *m) {
605 FOREACH_DIRENT(de, d, r = -errno; goto fail) {
606 char *p;
607
608- p = strjoin(streq(*i, "/") ? "" : *i, "/", de->d_name, NULL);
609+ p = strjoin(streq(*i, "/") ? "" : *i, "/", de->d_name);
610 if (!p) {
611 r = -ENOMEM;
612 goto fail;
613diff --git a/src/core/namespace.c b/src/core/namespace.c
614index 49a50c7b61..f5c0d42c05 100644
615--- a/src/core/namespace.c
616+++ b/src/core/namespace.c
617@@ -940,7 +940,7 @@ static int setup_one_tmp_dir(const char *id, const char *prefix, char **path) {
618 if (r < 0)
619 return r;
620
621- x = strjoin(prefix, "/systemd-private-", sd_id128_to_string(boot_id, bid), "-", id, "-XXXXXX", NULL);
622+ x = strjoin(prefix, "/systemd-private-", sd_id128_to_string(boot_id, bid), "-", id, "-XXXXXX");
623 if (!x)
624 return -ENOMEM;
625
626diff --git a/src/core/service.c b/src/core/service.c
627index a7274a758f..f6acc2f129 100644
628--- a/src/core/service.c
629+++ b/src/core/service.c
630@@ -3273,7 +3273,7 @@ int service_set_socket_fd(Service *s, int fd, Socket *sock, bool selinux_context
631 if (UNIT(s)->description) {
632 _cleanup_free_ char *a;
633
634- a = strjoin(UNIT(s)->description, " (", peer, ")", NULL);
635+ a = strjoin(UNIT(s)->description, " (", peer, ")");
636 if (!a)
637 return -ENOMEM;
638
639diff --git a/src/core/timer.c b/src/core/timer.c
640index 2469a517ea..c6b28dd9c5 100644
641--- a/src/core/timer.c
642+++ b/src/core/timer.c
643@@ -147,7 +147,7 @@ static int timer_setup_persistent(Timer *t) {
644
645 e = getenv("XDG_DATA_HOME");
646 if (e)
647- t->stamp_path = strjoin(e, "/systemd/timers/stamp-", UNIT(t)->id, NULL);
648+ t->stamp_path = strjoin(e, "/systemd/timers/stamp-", UNIT(t)->id);
649 else {
650
651 _cleanup_free_ char *h = NULL;
652@@ -156,7 +156,7 @@ static int timer_setup_persistent(Timer *t) {
653 if (r < 0)
654 return log_unit_error_errno(UNIT(t), r, "Failed to determine home directory: %m");
655
656- t->stamp_path = strjoin(h, "/.local/share/systemd/timers/stamp-", UNIT(t)->id, NULL);
657+ t->stamp_path = strjoin(h, "/.local/share/systemd/timers/stamp-", UNIT(t)->id);
658 }
659 }
660
661diff --git a/src/core/unit.c b/src/core/unit.c
662index e664e23892..fa1f3d9d4b 100644
663--- a/src/core/unit.c
664+++ b/src/core/unit.c
665@@ -2510,7 +2510,7 @@ int unit_set_default_slice(Unit *u) {
666 return -ENOMEM;
667
668 if (MANAGER_IS_SYSTEM(u->manager))
669- b = strjoin("system-", escaped, ".slice", NULL);
670+ b = strjoin("system-", escaped, ".slice");
671 else
672 b = strappend(escaped, ".slice");
673 if (!b)
674@@ -3670,7 +3670,7 @@ int unit_make_transient(Unit *u) {
675 if (!UNIT_VTABLE(u)->can_transient)
676 return -EOPNOTSUPP;
677
678- path = strjoin(u->manager->lookup_paths.transient, "/", u->id, NULL);
679+ path = strjoin(u->manager->lookup_paths.transient, "/", u->id);
680 if (!path)
681 return -ENOMEM;
682
683diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
684index a982c204be..6bd0e925eb 100644
685--- a/src/coredump/coredump.c
686+++ b/src/coredump/coredump.c
687@@ -729,7 +729,10 @@ static int submit_coredump(
688
689 r = coredump_make_stack_trace(coredump_fd, context[CONTEXT_EXE], &stacktrace);
690 if (r >= 0)
691- core_message = strjoin("MESSAGE=Process ", context[CONTEXT_PID], " (", context[CONTEXT_COMM], ") of user ", context[CONTEXT_UID], " dumped core.\n\n", stacktrace, NULL);
692+ core_message = strjoin("MESSAGE=Process ", context[CONTEXT_PID],
693+ " (", context[CONTEXT_COMM], ") of user ",
694+ context[CONTEXT_UID], " dumped core.\n\n",
695+ stacktrace);
696 else if (r == -EINVAL)
697 log_warning("Failed to generate stack trace: %s", dwfl_errmsg(dwfl_errno()));
698 else
699@@ -741,7 +744,9 @@ static int submit_coredump(
700 if (!core_message)
701 #endif
702 log:
703- core_message = strjoin("MESSAGE=Process ", context[CONTEXT_PID], " (", context[CONTEXT_COMM], ") of user ", context[CONTEXT_UID], " dumped core.", NULL);
704+ core_message = strjoin("MESSAGE=Process ", context[CONTEXT_PID], " (",
705+ context[CONTEXT_COMM], ") of user ",
706+ context[CONTEXT_UID], " dumped core.");
707 if (core_message)
708 IOVEC_SET_STRING(iovec[n_iovec++], core_message);
709
710diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c
711index 0e5351e621..877bbb34fc 100644
712--- a/src/coredump/coredumpctl.c
713+++ b/src/coredump/coredumpctl.c
714@@ -108,7 +108,7 @@ static int add_match(Set *set, const char *match) {
715 else
716 prefix = "COREDUMP_COMM=";
717
718- pattern = strjoin(prefix, match, NULL);
719+ pattern = strjoin(prefix, match);
720 if (!pattern) {
721 r = -ENOMEM;
722 goto fail;
723@@ -667,7 +667,7 @@ static int save_core(sd_journal *j, FILE *file, char **path, bool *unlink_temp)
724 if (r < 0)
725 return log_error_errno(r, "Failed to acquire temporary directory path: %m");
726
727- temp = strjoin(vt, "/coredump-XXXXXX", NULL);
728+ temp = strjoin(vt, "/coredump-XXXXXX");
729 if (!temp)
730 return log_oom();
731
732diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
733index e2dc4327fe..68029865a0 100644
734--- a/src/cryptsetup/cryptsetup-generator.c
735+++ b/src/cryptsetup/cryptsetup-generator.c
736@@ -86,7 +86,7 @@ static int create_disk(
737 if (r < 0)
738 return log_error_errno(r, "Failed to generate unit name: %m");
739
740- p = strjoin(arg_dest, "/", n, NULL);
741+ p = strjoin(arg_dest, "/", n);
742 if (!p)
743 return log_oom();
744
745@@ -188,7 +188,7 @@ static int create_disk(
746
747 if (!noauto) {
748
749- to = strjoin(arg_dest, "/", d, ".wants/", n, NULL);
750+ to = strjoin(arg_dest, "/", d, ".wants/", n);
751 if (!to)
752 return log_oom();
753
754@@ -198,9 +198,9 @@ static int create_disk(
755
756 free(to);
757 if (!nofail)
758- to = strjoin(arg_dest, "/cryptsetup.target.requires/", n, NULL);
759+ to = strjoin(arg_dest, "/cryptsetup.target.requires/", n);
760 else
761- to = strjoin(arg_dest, "/cryptsetup.target.wants/", n, NULL);
762+ to = strjoin(arg_dest, "/cryptsetup.target.wants/", n);
763 if (!to)
764 return log_oom();
765
766@@ -210,7 +210,7 @@ static int create_disk(
767 }
768
769 free(to);
770- to = strjoin(arg_dest, "/dev-mapper-", e, ".device.requires/", n, NULL);
771+ to = strjoin(arg_dest, "/dev-mapper-", e, ".device.requires/", n);
772 if (!to)
773 return log_oom();
774
775@@ -220,7 +220,7 @@ static int create_disk(
776
777 if (!noauto && !nofail) {
778 _cleanup_free_ char *dmname;
779- dmname = strjoin("dev-mapper-", e, ".device", NULL);
780+ dmname = strjoin("dev-mapper-", e, ".device");
781 if (!dmname)
782 return log_oom();
783
784diff --git a/src/debug-generator/debug-generator.c b/src/debug-generator/debug-generator.c
785index 7f11ec724d..1ee3471355 100644
786--- a/src/debug-generator/debug-generator.c
787+++ b/src/debug-generator/debug-generator.c
788@@ -113,7 +113,7 @@ static int generate_mask_symlinks(void) {
789 STRV_FOREACH(u, arg_mask) {
790 _cleanup_free_ char *p = NULL;
791
792- p = strjoin(arg_dest, "/", *u, NULL);
793+ p = strjoin(arg_dest, "/", *u);
794 if (!p)
795 return log_oom();
796
797@@ -136,7 +136,7 @@ static int generate_wants_symlinks(void) {
798 STRV_FOREACH(u, arg_wants) {
799 _cleanup_free_ char *p = NULL, *f = NULL;
800
801- p = strjoin(arg_dest, "/", arg_default_unit, ".wants/", *u, NULL);
802+ p = strjoin(arg_dest, "/", arg_default_unit, ".wants/", *u);
803 if (!p)
804 return log_oom();
805
806diff --git a/src/delta/delta.c b/src/delta/delta.c
807index f32744def2..6848662ccb 100644
808--- a/src/delta/delta.c
809+++ b/src/delta/delta.c
810@@ -214,7 +214,7 @@ static int enumerate_dir_d(Hashmap *top, Hashmap *bottom, Hashmap *drops, const
811
812 assert(!endswith(drop, "/"));
813
814- path = strjoin(toppath, "/", drop, NULL);
815+ path = strjoin(toppath, "/", drop);
816 if (!path)
817 return -ENOMEM;
818
819@@ -242,7 +242,7 @@ static int enumerate_dir_d(Hashmap *top, Hashmap *bottom, Hashmap *drops, const
820 if (!endswith(*file, ".conf"))
821 continue;
822
823- p = strjoin(path, "/", *file, NULL);
824+ p = strjoin(path, "/", *file);
825 if (!p)
826 return -ENOMEM;
827 d = p + strlen(toppath) + 1;
828@@ -330,7 +330,7 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, Hashmap *drops, const ch
829 if (!dirent_is_file(de))
830 continue;
831
832- p = strjoin(path, "/", de->d_name, NULL);
833+ p = strjoin(path, "/", de->d_name);
834 if (!p)
835 return -ENOMEM;
836
837@@ -383,7 +383,7 @@ static int process_suffix(const char *suffix, const char *onlyprefix) {
838 NULSTR_FOREACH(p, prefixes) {
839 _cleanup_free_ char *t = NULL;
840
841- t = strjoin(p, "/", suffix, NULL);
842+ t = strjoin(p, "/", suffix);
843 if (!t) {
844 r = -ENOMEM;
845 goto finish;
846diff --git a/src/escape/escape.c b/src/escape/escape.c
847index 9f39049577..af98c98e40 100644
848--- a/src/escape/escape.c
849+++ b/src/escape/escape.c
850@@ -191,7 +191,7 @@ int main(int argc, char *argv[]) {
851 } else if (arg_suffix) {
852 char *x;
853
854- x = strjoin(e, ".", arg_suffix, NULL);
855+ x = strjoin(e, ".", arg_suffix);
856 if (!x) {
857 r = log_oom();
858 goto finish;
859diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
860index e77bd71a52..46507de937 100644
861--- a/src/fstab-generator/fstab-generator.c
862+++ b/src/fstab-generator/fstab-generator.c
863@@ -80,7 +80,7 @@ static int add_swap(
864 if (r < 0)
865 return log_error_errno(r, "Failed to generate unit name: %m");
866
867- unit = strjoin(arg_dest, "/", name, NULL);
868+ unit = strjoin(arg_dest, "/", name);
869 if (!unit)
870 return log_oom();
871
872@@ -275,7 +275,7 @@ static int add_mount(
873 if (r < 0)
874 return log_error_errno(r, "Failed to generate unit name: %m");
875
876- unit = strjoin(arg_dest, "/", name, NULL);
877+ unit = strjoin(arg_dest, "/", name);
878 if (!unit)
879 return log_oom();
880
881@@ -335,7 +335,7 @@ static int add_mount(
882 return log_error_errno(r, "Failed to write unit file %s: %m", unit);
883
884 if (!noauto && !automount) {
885- lnk = strjoin(arg_dest, "/", post, nofail ? ".wants/" : ".requires/", name, NULL);
886+ lnk = strjoin(arg_dest, "/", post, nofail ? ".wants/" : ".requires/", name);
887 if (!lnk)
888 return log_oom();
889
890@@ -349,7 +349,7 @@ static int add_mount(
891 if (r < 0)
892 return log_error_errno(r, "Failed to generate unit name: %m");
893
894- automount_unit = strjoin(arg_dest, "/", automount_name, NULL);
895+ automount_unit = strjoin(arg_dest, "/", automount_name);
896 if (!automount_unit)
897 return log_oom();
898
899@@ -391,7 +391,7 @@ static int add_mount(
900 return log_error_errno(r, "Failed to write unit file %s: %m", automount_unit);
901
902 free(lnk);
903- lnk = strjoin(arg_dest, "/", post, nofail ? ".wants/" : ".requires/", automount_name, NULL);
904+ lnk = strjoin(arg_dest, "/", post, nofail ? ".wants/" : ".requires/", automount_name);
905 if (!lnk)
906 return log_oom();
907
908@@ -619,7 +619,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
909 char *o;
910
911 o = arg_root_options ?
912- strjoin(arg_root_options, ",", value, NULL) :
913+ strjoin(arg_root_options, ",", value) :
914 strdup(value);
915 if (!o)
916 return log_oom();
917@@ -641,7 +641,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
918 char *o;
919
920 o = arg_usr_options ?
921- strjoin(arg_usr_options, ",", value, NULL) :
922+ strjoin(arg_usr_options, ",", value) :
923 strdup(value);
924 if (!o)
925 return log_oom();
926diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
927index a098b27a8e..e64d5bb231 100644
928--- a/src/gpt-auto-generator/gpt-auto-generator.c
929+++ b/src/gpt-auto-generator/gpt-auto-generator.c
930@@ -76,7 +76,7 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, char **devi
931 if (r < 0)
932 return log_error_errno(r, "Failed to generate unit name: %m");
933
934- p = strjoin(arg_dest, "/", n, NULL);
935+ p = strjoin(arg_dest, "/", n);
936 if (!p)
937 return log_oom();
938
939@@ -111,7 +111,7 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, char **devi
940
941 from = strjoina("../", n);
942
943- to = strjoin(arg_dest, "/", d, ".wants/", n, NULL);
944+ to = strjoin(arg_dest, "/", d, ".wants/", n);
945 if (!to)
946 return log_oom();
947
948@@ -120,7 +120,7 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, char **devi
949 return log_error_errno(errno, "Failed to create symlink %s: %m", to);
950
951 free(to);
952- to = strjoin(arg_dest, "/cryptsetup.target.requires/", n, NULL);
953+ to = strjoin(arg_dest, "/cryptsetup.target.requires/", n);
954 if (!to)
955 return log_oom();
956
957@@ -129,7 +129,7 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, char **devi
958 return log_error_errno(errno, "Failed to create symlink %s: %m", to);
959
960 free(to);
961- to = strjoin(arg_dest, "/dev-mapper-", e, ".device.requires/", n, NULL);
962+ to = strjoin(arg_dest, "/dev-mapper-", e, ".device.requires/", n);
963 if (!to)
964 return log_oom();
965
966@@ -138,7 +138,7 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, char **devi
967 return log_error_errno(errno, "Failed to create symlink %s: %m", to);
968
969 free(p);
970- p = strjoin(arg_dest, "/dev-mapper-", e, ".device.d/50-job-timeout-sec-0.conf", NULL);
971+ p = strjoin(arg_dest, "/dev-mapper-", e, ".device.d/50-job-timeout-sec-0.conf");
972 if (!p)
973 return log_oom();
974
975@@ -194,7 +194,7 @@ static int add_mount(
976 if (r < 0)
977 return log_error_errno(r, "Failed to generate unit name: %m");
978
979- p = strjoin(arg_dest, "/", unit, NULL);
980+ p = strjoin(arg_dest, "/", unit);
981 if (!p)
982 return log_oom();
983
984@@ -236,7 +236,7 @@ static int add_mount(
985 return log_error_errno(r, "Failed to write unit file %s: %m", p);
986
987 if (post) {
988- lnk = strjoin(arg_dest, "/", post, ".requires/", unit, NULL);
989+ lnk = strjoin(arg_dest, "/", post, ".requires/", unit);
990 if (!lnk)
991 return log_oom();
992
993@@ -340,7 +340,7 @@ static int add_swap(const char *path) {
994 if (r < 0)
995 return log_error_errno(r, "Failed to generate unit name: %m");
996
997- unit = strjoin(arg_dest, "/", name, NULL);
998+ unit = strjoin(arg_dest, "/", name);
999 if (!unit)
1000 return log_oom();
1001
1002@@ -361,7 +361,7 @@ static int add_swap(const char *path) {
1003 if (r < 0)
1004 return log_error_errno(r, "Failed to write unit file %s: %m", unit);
1005
1006- lnk = strjoin(arg_dest, "/" SPECIAL_SWAP_TARGET ".wants/", name, NULL);
1007+ lnk = strjoin(arg_dest, "/" SPECIAL_SWAP_TARGET ".wants/", name);
1008 if (!lnk)
1009 return log_oom();
1010
1011@@ -393,7 +393,7 @@ static int add_automount(
1012 assert(description);
1013
1014 if (options)
1015- opt = strjoin(options, ",noauto", NULL);
1016+ opt = strjoin(options, ",noauto");
1017 else
1018 opt = strdup("noauto");
1019 if (!opt)
1020@@ -414,7 +414,7 @@ static int add_automount(
1021 if (r < 0)
1022 return log_error_errno(r, "Failed to generate unit name: %m");
1023
1024- p = strjoin(arg_dest, "/", unit, NULL);
1025+ p = strjoin(arg_dest, "/", unit);
1026 if (!p)
1027 return log_oom();
1028
1029@@ -438,7 +438,7 @@ static int add_automount(
1030 if (r < 0)
1031 return log_error_errno(r, "Failed to write unit file %s: %m", p);
1032
1033- lnk = strjoin(arg_dest, "/" SPECIAL_LOCAL_FS_TARGET ".wants/", unit, NULL);
1034+ lnk = strjoin(arg_dest, "/" SPECIAL_LOCAL_FS_TARGET ".wants/", unit);
1035 if (!lnk)
1036 return log_oom();
1037 mkdir_parents_label(lnk, 0755);
1038diff --git a/src/hibernate-resume/hibernate-resume-generator.c b/src/hibernate-resume/hibernate-resume-generator.c
1039index 17e670604e..9f59c04b26 100644
1040--- a/src/hibernate-resume/hibernate-resume-generator.c
1041+++ b/src/hibernate-resume/hibernate-resume-generator.c
1042@@ -56,7 +56,7 @@ static int process_resume(void) {
1043 if (r < 0)
1044 return log_error_errno(r, "Failed to generate unit name: %m");
1045
1046- lnk = strjoin(arg_dest, "/" SPECIAL_SYSINIT_TARGET ".wants/", name, NULL);
1047+ lnk = strjoin(arg_dest, "/" SPECIAL_SYSINIT_TARGET ".wants/", name);
1048 if (!lnk)
1049 return log_oom();
1050
1051diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
1052index 197f905b7d..74256e4444 100644
1053--- a/src/hostname/hostnamed.c
1054+++ b/src/hostname/hostnamed.c
1055@@ -335,7 +335,7 @@ static int context_write_data_machine_info(Context *c) {
1056 continue;
1057 }
1058
1059- t = strjoin(name[p], "=", c->data[p], NULL);
1060+ t = strjoin(name[p], "=", c->data[p]);
1061 if (!t)
1062 return -ENOMEM;
1063
1064diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c
1065index ab1feb435b..1d16d9f8aa 100644
1066--- a/src/hwdb/hwdb.c
1067+++ b/src/hwdb/hwdb.c
1068@@ -669,7 +669,7 @@ static int hwdb_update(int argc, char *argv[], void *userdata) {
1069 log_debug("strings dedup'ed: %8zu bytes (%8zu)",
1070 trie->strings->dedup_len, trie->strings->dedup_count);
1071
1072- hwdb_bin = strjoin(arg_root, "/", arg_hwdb_bin_dir, "/hwdb.bin", NULL);
1073+ hwdb_bin = strjoin(arg_root, "/", arg_hwdb_bin_dir, "/hwdb.bin");
1074 if (!hwdb_bin)
1075 return -ENOMEM;
1076
1077diff --git a/src/import/import-raw.c b/src/import/import-raw.c
1078index 29f3f896e5..808eae38f8 100644
1079--- a/src/import/import-raw.c
1080+++ b/src/import/import-raw.c
1081@@ -267,7 +267,7 @@ static int raw_import_open_disk(RawImport *i) {
1082 assert(!i->temp_path);
1083 assert(i->output_fd < 0);
1084
1085- i->final_path = strjoin(i->image_root, "/", i->local, ".raw", NULL);
1086+ i->final_path = strjoin(i->image_root, "/", i->local, ".raw");
1087 if (!i->final_path)
1088 return log_oom();
1089
1090diff --git a/src/import/import-tar.c b/src/import/import-tar.c
1091index 22f9b8c5ea..1c229ec82f 100644
1092--- a/src/import/import-tar.c
1093+++ b/src/import/import-tar.c
1094@@ -222,7 +222,7 @@ static int tar_import_fork_tar(TarImport *i) {
1095 assert(!i->temp_path);
1096 assert(i->tar_fd < 0);
1097
1098- i->final_path = strjoin(i->image_root, "/", i->local, NULL);
1099+ i->final_path = strjoin(i->image_root, "/", i->local);
1100 if (!i->final_path)
1101 return log_oom();
1102
1103diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c
1104index 7325adee8f..f75a6f06d2 100644
1105--- a/src/journal-remote/journal-gatewayd.c
1106+++ b/src/journal-remote/journal-gatewayd.c
1107@@ -434,7 +434,7 @@ static int request_parse_arguments_iterator(
1108 return MHD_YES;
1109 }
1110
1111- p = strjoin(key, "=", strempty(value), NULL);
1112+ p = strjoin(key, "=", strempty(value));
1113 if (!p) {
1114 m->argument_parse_error = log_oom();
1115 return MHD_NO;
1116diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c
1117index 61190ff83c..42880cca76 100644
1118--- a/src/journal-remote/journal-upload.c
1119+++ b/src/journal-remote/journal-upload.c
1120@@ -438,7 +438,7 @@ static int setup_uploader(Uploader *u, const char *url, const char *state_file)
1121 }
1122
1123 if (strchr(host, ':'))
1124- u->url = strjoin(proto, url, "/upload", NULL);
1125+ u->url = strjoin(proto, url, "/upload");
1126 else {
1127 char *t;
1128 size_t x;
1129@@ -448,7 +448,7 @@ static int setup_uploader(Uploader *u, const char *url, const char *state_file)
1130 while (x > 0 && t[x - 1] == '/')
1131 t[x - 1] = '\0';
1132
1133- u->url = strjoin(proto, t, ":" STRINGIFY(DEFAULT_PORT), "/upload", NULL);
1134+ u->url = strjoin(proto, t, ":" STRINGIFY(DEFAULT_PORT), "/upload");
1135 }
1136 if (!u->url)
1137 return log_oom();
1138diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
1139index 7f997487b4..22cab67824 100644
1140--- a/src/journal/journalctl.c
1141+++ b/src/journal/journalctl.c
1142@@ -192,7 +192,7 @@ static int add_matches_for_device(sd_journal *j, const char *devpath) {
1143 continue;
1144 }
1145
1146- match = strjoin("_KERNEL_DEVICE=+", subsys, ":", sysname, NULL);
1147+ match = strjoin("_KERNEL_DEVICE=+", subsys, ":", sysname);
1148 if (!match)
1149 return log_oom();
1150
1151diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
1152index ced0ad6f21..575070b343 100644
1153--- a/src/journal/journald-server.c
1154+++ b/src/journal/journald-server.c
1155@@ -730,7 +730,7 @@ static int get_invocation_id(const char *cgroup_root, const char *slice, const c
1156 if (!escaped)
1157 return -ENOMEM;
1158
1159- p = strjoin(cgroup_root, "/", slice_path, "/", escaped, NULL);
1160+ p = strjoin(cgroup_root, "/", slice_path, "/", escaped);
1161 if (!p)
1162 return -ENOMEM;
1163
1164@@ -2052,8 +2052,8 @@ int server_init(Server *s) {
1165 s->runtime_storage.name = "Runtime journal";
1166 s->system_storage.name = "System journal";
1167
1168- s->runtime_storage.path = strjoin("/run/log/journal/", SERVER_MACHINE_ID(s), NULL);
1169- s->system_storage.path = strjoin("/var/log/journal/", SERVER_MACHINE_ID(s), NULL);
1170+ s->runtime_storage.path = strjoin("/run/log/journal/", SERVER_MACHINE_ID(s));
1171+ s->system_storage.path = strjoin("/var/log/journal/", SERVER_MACHINE_ID(s));
1172 if (!s->runtime_storage.path || !s->system_storage.path)
1173 return -ENOMEM;
1174
1175diff --git a/src/journal/journald-wall.c b/src/journal/journald-wall.c
1176index 4d91fafffe..d857ff8d39 100644
1177--- a/src/journal/journald-wall.c
1178+++ b/src/journal/journald-wall.c
1179@@ -57,7 +57,7 @@ void server_forward_wall(
1180
1181 } else if (identifier) {
1182
1183- l = l_buf = strjoin(identifier, ": ", message, NULL);
1184+ l = l_buf = strjoin(identifier, ": ", message);
1185 if (!l_buf) {
1186 log_oom();
1187 return;
1188diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
1189index f2f8546086..47c77b1ba9 100644
1190--- a/src/journal/sd-journal.c
1191+++ b/src/journal/sd-journal.c
1192@@ -405,7 +405,7 @@ static char *match_make_string(Match *m) {
1193 return mfree(p);
1194
1195 if (p) {
1196- k = strjoin(p, m->type == MATCH_OR_TERM ? " OR " : " AND ", t, NULL);
1197+ k = strjoin(p, m->type == MATCH_OR_TERM ? " OR " : " AND ", t);
1198 free(p);
1199 free(t);
1200
1201@@ -420,7 +420,7 @@ static char *match_make_string(Match *m) {
1202 }
1203
1204 if (enclose) {
1205- r = strjoin("(", p, ")", NULL);
1206+ r = strjoin("(", p, ")");
1207 free(p);
1208 return r;
1209 }
1210@@ -1416,7 +1416,7 @@ static int add_directory(sd_journal *j, const char *prefix, const char *dirname)
1211 * and reenumerates directory contents */
1212
1213 if (dirname)
1214- path = strjoin(prefix, "/", dirname, NULL);
1215+ path = strjoin(prefix, "/", dirname);
1216 else
1217 path = strdup(prefix);
1218 if (!path) {
1219diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
1220index 59398b841d..a3427ca33e 100644
1221--- a/src/libsystemd/sd-bus/bus-kernel.c
1222+++ b/src/libsystemd/sd-bus/bus-kernel.c
1223@@ -1649,7 +1649,7 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) {
1224 if (s) {
1225 char *p;
1226
1227- p = strjoin("/sys/fs/kdbus/", n->str, "/bus", NULL);
1228+ p = strjoin("/sys/fs/kdbus/", n->str, "/bus");
1229 if (!p) {
1230 safe_close(fd);
1231 return -ENOMEM;
1232diff --git a/src/libsystemd/sd-bus/busctl-introspect.c b/src/libsystemd/sd-bus/busctl-introspect.c
1233index b09509f8e1..09cbd9ab44 100644
1234--- a/src/libsystemd/sd-bus/busctl-introspect.c
1235+++ b/src/libsystemd/sd-bus/busctl-introspect.c
1236@@ -285,7 +285,7 @@ static int parse_xml_node(Context *context, const char *prefix, unsigned n_depth
1237 if (endswith(prefix, "/"))
1238 node_path = strappend(prefix, name);
1239 else
1240- node_path = strjoin(prefix, "/", name, NULL);
1241+ node_path = strjoin(prefix, "/", name);
1242 if (!node_path)
1243 return log_oom();
1244 }
1245diff --git a/src/libsystemd/sd-bus/busctl.c b/src/libsystemd/sd-bus/busctl.c
1246index 2c3f591053..9dd3828364 100644
1247--- a/src/libsystemd/sd-bus/busctl.c
1248+++ b/src/libsystemd/sd-bus/busctl.c
1249@@ -1102,7 +1102,7 @@ static int monitor(sd_bus *bus, char *argv[], int (*dump)(sd_bus_message *m, FIL
1250 return -EINVAL;
1251 }
1252
1253- m = strjoin("sender='", *i, "'", NULL);
1254+ m = strjoin("sender='", *i, "'");
1255 if (!m)
1256 return log_oom();
1257
1258@@ -1111,7 +1111,7 @@ static int monitor(sd_bus *bus, char *argv[], int (*dump)(sd_bus_message *m, FIL
1259 return bus_log_create_error(r);
1260
1261 free(m);
1262- m = strjoin("destination='", *i, "'", NULL);
1263+ m = strjoin("destination='", *i, "'");
1264 if (!m)
1265 return log_oom();
1266
1267diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
1268index d746348544..e809942278 100644
1269--- a/src/libsystemd/sd-bus/sd-bus.c
1270+++ b/src/libsystemd/sd-bus/sd-bus.c
1271@@ -1339,7 +1339,7 @@ int bus_set_address_system_remote(sd_bus *b, const char *host) {
1272 return -ENOMEM;
1273 }
1274
1275- b->address = strjoin("unixexec:path=ssh,argv1=-xT,argv2=", e, ",argv3=systemd-stdio-bridge", c, NULL);
1276+ b->address = strjoin("unixexec:path=ssh,argv1=-xT,argv2=", e, ",argv3=systemd-stdio-bridge", c);
1277 if (!b->address)
1278 return -ENOMEM;
1279
1280@@ -1387,7 +1387,7 @@ int bus_set_address_system_machine(sd_bus *b, const char *machine) {
1281 if (!e)
1282 return -ENOMEM;
1283
1284- b->address = strjoin("x-machine-kernel:machine=", e, ";x-machine-unix:machine=", e, NULL);
1285+ b->address = strjoin("x-machine-kernel:machine=", e, ";x-machine-unix:machine=", e);
1286 if (!b->address)
1287 return -ENOMEM;
1288
1289@@ -3470,7 +3470,7 @@ _public_ int sd_bus_path_encode(const char *prefix, const char *external_id, cha
1290 if (!e)
1291 return -ENOMEM;
1292
1293- ret = strjoin(prefix, "/", e, NULL);
1294+ ret = strjoin(prefix, "/", e);
1295 if (!ret)
1296 return -ENOMEM;
1297
1298diff --git a/src/libsystemd/sd-bus/test-bus-objects.c b/src/libsystemd/sd-bus/test-bus-objects.c
1299index f11cafd888..233a21a523 100644
1300--- a/src/libsystemd/sd-bus/test-bus-objects.c
1301+++ b/src/libsystemd/sd-bus/test-bus-objects.c
1302@@ -49,7 +49,7 @@ static int something_handler(sd_bus_message *m, void *userdata, sd_bus_error *er
1303 r = sd_bus_message_read(m, "s", &s);
1304 assert_se(r > 0);
1305
1306- n = strjoin("<<<", s, ">>>", NULL);
1307+ n = strjoin("<<<", s, ">>>");
1308 assert_se(n);
1309
1310 free(c->something);
1311diff --git a/src/libsystemd/sd-device/device-enumerator.c b/src/libsystemd/sd-device/device-enumerator.c
1312index 62d03ae00d..86f8935a14 100644
1313--- a/src/libsystemd/sd-device/device-enumerator.c
1314+++ b/src/libsystemd/sd-device/device-enumerator.c
1315@@ -773,7 +773,7 @@ static int parent_crawl_children(sd_device_enumerator *enumerator, const char *p
1316 if (dent->d_type != DT_DIR)
1317 continue;
1318
1319- child = strjoin(path, "/", dent->d_name, NULL);
1320+ child = strjoin(path, "/", dent->d_name);
1321 if (!child)
1322 return -ENOMEM;
1323
1324diff --git a/src/libsystemd/sd-path/sd-path.c b/src/libsystemd/sd-path/sd-path.c
1325index b7aec1f20a..752c1ba56b 100644
1326--- a/src/libsystemd/sd-path/sd-path.c
1327+++ b/src/libsystemd/sd-path/sd-path.c
1328@@ -77,7 +77,7 @@ static int from_home_dir(const char *envname, const char *suffix, char **buffer,
1329 if (endswith(h, "/"))
1330 cc = strappend(h, suffix);
1331 else
1332- cc = strjoin(h, "/", suffix, NULL);
1333+ cc = strjoin(h, "/", suffix);
1334 if (!cc)
1335 return -ENOMEM;
1336
1337@@ -387,7 +387,7 @@ _public_ int sd_path_home(uint64_t type, const char *suffix, char **path) {
1338 if (endswith(ret, "/"))
1339 cc = strappend(ret, suffix);
1340 else
1341- cc = strjoin(ret, "/", suffix, NULL);
1342+ cc = strjoin(ret, "/", suffix);
1343
1344 free(buffer);
1345
1346@@ -455,7 +455,7 @@ static int search_from_environment(
1347 if (endswith(e, "/"))
1348 h = strappend(e, home_suffix);
1349 else
1350- h = strjoin(e, "/", home_suffix, NULL);
1351+ h = strjoin(e, "/", home_suffix);
1352
1353 if (!h) {
1354 strv_free(l);
1355@@ -621,7 +621,7 @@ _public_ int sd_path_search(uint64_t type, const char *suffix, char ***paths) {
1356 if (endswith(*i, "/"))
1357 *j = strappend(*i, suffix);
1358 else
1359- *j = strjoin(*i, "/", suffix, NULL);
1360+ *j = strjoin(*i, "/", suffix);
1361
1362 if (!*j) {
1363 strv_free(l);
1364diff --git a/src/locale/keymap-util.c b/src/locale/keymap-util.c
1365index a6bcd1ad54..da72bee4a9 100644
1366--- a/src/locale/keymap-util.c
1367+++ b/src/locale/keymap-util.c
1368@@ -519,7 +519,7 @@ int find_converted_keymap(const char *x11_layout, const char *x11_variant, char
1369 _cleanup_free_ char *n;
1370
1371 if (x11_variant)
1372- n = strjoin(x11_layout, "-", x11_variant, NULL);
1373+ n = strjoin(x11_layout, "-", x11_variant);
1374 else
1375 n = strdup(x11_layout);
1376 if (!n)
1377@@ -529,8 +529,8 @@ int find_converted_keymap(const char *x11_layout, const char *x11_variant, char
1378 _cleanup_free_ char *p = NULL, *pz = NULL;
1379 bool uncompressed;
1380
1381- p = strjoin(dir, "xkb/", n, ".map", NULL);
1382- pz = strjoin(dir, "xkb/", n, ".map.gz", NULL);
1383+ p = strjoin(dir, "xkb/", n, ".map");
1384+ pz = strjoin(dir, "xkb/", n, ".map.gz");
1385 if (!p || !pz)
1386 return -ENOMEM;
1387
1388diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
1389index c93b24009b..a7e5c01ef3 100644
1390--- a/src/login/logind-inhibit.c
1391+++ b/src/login/logind-inhibit.c
1392@@ -294,7 +294,7 @@ int inhibitor_create_fifo(Inhibitor *i) {
1393 if (r < 0)
1394 return r;
1395
1396- i->fifo_path = strjoin("/run/systemd/inhibit/", i->id, ".ref", NULL);
1397+ i->fifo_path = strjoin("/run/systemd/inhibit/", i->id, ".ref");
1398 if (!i->fifo_path)
1399 return -ENOMEM;
1400
1401diff --git a/src/login/logind-session.c b/src/login/logind-session.c
1402index cbf035f706..e83c37a5ac 100644
1403--- a/src/login/logind-session.c
1404+++ b/src/login/logind-session.c
1405@@ -505,7 +505,7 @@ static int session_start_scope(Session *s) {
1406 char *scope, *job = NULL;
1407 const char *description;
1408
1409- scope = strjoin("session-", s->id, ".scope", NULL);
1410+ scope = strjoin("session-", s->id, ".scope");
1411 if (!scope)
1412 return log_oom();
1413
1414diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c
1415index 4f023640f6..b0f75b2a21 100644
1416--- a/src/login/pam_systemd.c
1417+++ b/src/login/pam_systemd.c
1418@@ -186,7 +186,7 @@ static int export_legacy_dbus_address(
1419 * daemons that spawn dbus-daemon, instead of forcing
1420 * DBUS_SESSION_BUS_ADDRESS= here. */
1421
1422- s = strjoin(runtime, "/bus", NULL);
1423+ s = strjoin(runtime, "/bus");
1424 if (!s)
1425 goto error;
1426
1427diff --git a/src/machine/machine.c b/src/machine/machine.c
1428index a02b9d7575..9e7b6cc03d 100644
1429--- a/src/machine/machine.c
1430+++ b/src/machine/machine.c
1431@@ -355,7 +355,7 @@ static int machine_start_scope(Machine *m, sd_bus_message *properties, sd_bus_er
1432 if (!escaped)
1433 return log_oom();
1434
1435- scope = strjoin("machine-", escaped, ".scope", NULL);
1436+ scope = strjoin("machine-", escaped, ".scope");
1437 if (!scope)
1438 return log_oom();
1439
1440diff --git a/src/mount/mount-tool.c b/src/mount/mount-tool.c
1441index 80bba086e4..9d79e81918 100644
1442--- a/src/mount/mount-tool.c
1443+++ b/src/mount/mount-tool.c
1444@@ -697,7 +697,7 @@ static int acquire_mount_where(struct udev_device *d) {
1445 if (!filename_is_valid(escaped))
1446 return 0;
1447
1448- arg_mount_where = strjoin("/run/media/system/", escaped, NULL);
1449+ arg_mount_where = strjoin("/run/media/system/", escaped);
1450 } else
1451 arg_mount_where = strdup(v);
1452
1453@@ -721,7 +721,7 @@ static int acquire_description(struct udev_device *d) {
1454 label = udev_device_get_property_value(d, "ID_PART_ENTRY_NUMBER");
1455
1456 if (model && label)
1457- arg_description = strjoin(model, " ", label, NULL);
1458+ arg_description = strjoin(model, " ", label);
1459 else if (label)
1460 arg_description = strdup(label);
1461 else if (model)
1462diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c
1463index 115de64cf9..52fa0ee907 100644
1464--- a/src/nspawn/nspawn-mount.c
1465+++ b/src/nspawn/nspawn-mount.c
1466@@ -208,9 +208,9 @@ static int tmpfs_patch_options(
1467 char *t;
1468
1469 if (options)
1470- t = strjoin(options, ",context=\"", selinux_apifs_context, "\"", NULL);
1471+ t = strjoin(options, ",context=\"", selinux_apifs_context, "\"");
1472 else
1473- t = strjoin("context=\"", selinux_apifs_context, "\"", NULL);
1474+ t = strjoin("context=\"", selinux_apifs_context, "\"");
1475 if (!t) {
1476 free(buf);
1477 return -ENOMEM;
1478diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
1479index 0e2f4d59a5..d9abd566bb 100644
1480--- a/src/nspawn/nspawn.c
1481+++ b/src/nspawn/nspawn.c
1482@@ -2567,7 +2567,7 @@ static int determine_names(void) {
1483 * search for a machine, but instead create a new one
1484 * in /var/lib/machine. */
1485
1486- arg_directory = strjoin("/var/lib/machines/", arg_machine, NULL);
1487+ arg_directory = strjoin("/var/lib/machines/", arg_machine);
1488 if (!arg_directory)
1489 return log_oom();
1490 }
1491@@ -3410,7 +3410,7 @@ static int load_settings(void) {
1492 FOREACH_STRING(i, "/etc/systemd/nspawn", "/run/systemd/nspawn") {
1493 _cleanup_free_ char *j = NULL;
1494
1495- j = strjoin(i, "/", fn, NULL);
1496+ j = strjoin(i, "/", fn);
1497 if (!j)
1498 return log_oom();
1499
1500diff --git a/src/rc-local-generator/rc-local-generator.c b/src/rc-local-generator/rc-local-generator.c
1501index 618bbe428d..b704ca3b4b 100644
1502--- a/src/rc-local-generator/rc-local-generator.c
1503+++ b/src/rc-local-generator/rc-local-generator.c
1504@@ -45,11 +45,11 @@ static int add_symlink(const char *service, const char *where) {
1505 assert(service);
1506 assert(where);
1507
1508- from = strjoin(SYSTEM_DATA_UNIT_PATH, "/", service, NULL);
1509+ from = strjoin(SYSTEM_DATA_UNIT_PATH, "/", service);
1510 if (!from)
1511 return log_oom();
1512
1513- to = strjoin(arg_dest, "/", where, ".wants/", service, NULL);
1514+ to = strjoin(arg_dest, "/", where, ".wants/", service);
1515 if (!to)
1516 return log_oom();
1517
1518diff --git a/src/resolve/resolved-dns-dnssec.c b/src/resolve/resolved-dns-dnssec.c
1519index d4a267c89f..51327105d0 100644
1520--- a/src/resolve/resolved-dns-dnssec.c
1521+++ b/src/resolve/resolved-dns-dnssec.c
1522@@ -1303,7 +1303,7 @@ static int nsec3_hashed_domain_format(const uint8_t *hashed, size_t hashed_size,
1523 if (!l)
1524 return -ENOMEM;
1525
1526- j = strjoin(l, ".", zone, NULL);
1527+ j = strjoin(l, ".", zone);
1528 if (!j)
1529 return -ENOMEM;
1530
1531diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c
1532index 87e4abec6e..209d565033 100644
1533--- a/src/resolve/resolved-dns-rr.c
1534+++ b/src/resolve/resolved-dns-rr.c
1535@@ -792,7 +792,7 @@ static char *format_types(Bitmap *types) {
1536 if (!str)
1537 return NULL;
1538
1539- return strjoin("( ", str, " )", NULL);
1540+ return strjoin("( ", str, " )");
1541 }
1542
1543 static char *format_txt(DnsTxtItem *first) {
1544@@ -861,14 +861,14 @@ const char *dns_resource_record_to_string(DnsResourceRecord *rr) {
1545 case DNS_TYPE_NS:
1546 case DNS_TYPE_CNAME:
1547 case DNS_TYPE_DNAME:
1548- s = strjoin(k, " ", rr->ptr.name, NULL);
1549+ s = strjoin(k, " ", rr->ptr.name);
1550 if (!s)
1551 return NULL;
1552
1553 break;
1554
1555 case DNS_TYPE_HINFO:
1556- s = strjoin(k, " ", rr->hinfo.cpu, " ", rr->hinfo.os, NULL);
1557+ s = strjoin(k, " ", rr->hinfo.cpu, " ", rr->hinfo.os);
1558 if (!s)
1559 return NULL;
1560 break;
1561@@ -879,7 +879,7 @@ const char *dns_resource_record_to_string(DnsResourceRecord *rr) {
1562 if (!t)
1563 return NULL;
1564
1565- s = strjoin(k, " ", t, NULL);
1566+ s = strjoin(k, " ", t);
1567 if (!s)
1568 return NULL;
1569 break;
1570@@ -891,7 +891,7 @@ const char *dns_resource_record_to_string(DnsResourceRecord *rr) {
1571 if (r < 0)
1572 return NULL;
1573
1574- s = strjoin(k, " ", x, NULL);
1575+ s = strjoin(k, " ", x);
1576 if (!s)
1577 return NULL;
1578 break;
1579@@ -902,7 +902,7 @@ const char *dns_resource_record_to_string(DnsResourceRecord *rr) {
1580 if (r < 0)
1581 return NULL;
1582
1583- s = strjoin(k, " ", t, NULL);
1584+ s = strjoin(k, " ", t);
1585 if (!s)
1586 return NULL;
1587 break;
1588@@ -942,7 +942,7 @@ const char *dns_resource_record_to_string(DnsResourceRecord *rr) {
1589 if (!t)
1590 return NULL;
1591
1592- s = strjoin(k, " ", t, NULL);
1593+ s = strjoin(k, " ", t);
1594 if (!s)
1595 return NULL;
1596 break;
1597diff --git a/src/resolve/test-dnssec-complex.c b/src/resolve/test-dnssec-complex.c
1598index 58c089eb40..3d7074af11 100644
1599--- a/src/resolve/test-dnssec-complex.c
1600+++ b/src/resolve/test-dnssec-complex.c
1601@@ -42,7 +42,7 @@ static void prefix_random(const char *name, char **ret) {
1602 char *x;
1603
1604 assert_se(asprintf(&b, "x%" PRIu64 "x", random_u64()));
1605- x = strjoin(b, ".", name, NULL);
1606+ x = strjoin(b, ".", name);
1607 assert_se(x);
1608
1609 free(m);
1610diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c
1611index 0acdf229ed..c0f138b4f4 100644
1612--- a/src/rfkill/rfkill.c
1613+++ b/src/rfkill/rfkill.c
1614@@ -184,9 +184,9 @@ static int determine_state_file(
1615 if (!escaped_path_id)
1616 return log_oom();
1617
1618- state_file = strjoin("/var/lib/systemd/rfkill/", escaped_path_id, ":", type, NULL);
1619+ state_file = strjoin("/var/lib/systemd/rfkill/", escaped_path_id, ":", type);
1620 } else
1621- state_file = strjoin("/var/lib/systemd/rfkill/", type, NULL);
1622+ state_file = strjoin("/var/lib/systemd/rfkill/", type);
1623
1624 if (!state_file)
1625 return log_oom();
1626diff --git a/src/run/run.c b/src/run/run.c
1627index 81b53fdfab..8f1cc9e2e3 100644
1628--- a/src/run/run.c
1629+++ b/src/run/run.c
1630@@ -747,7 +747,7 @@ static int make_unit_name(sd_bus *bus, UnitType t, char **ret) {
1631 return -EINVAL;
1632 }
1633
1634- p = strjoin("run-u", id, ".", unit_type_to_string(t), NULL);
1635+ p = strjoin("run-u", id, ".", unit_type_to_string(t));
1636 if (!p)
1637 return log_oom();
1638
1639diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
1640index 59a34a9d11..f1fbce9dca 100644
1641--- a/src/shared/base-filesystem.c
1642+++ b/src/shared/base-filesystem.c
1643@@ -82,7 +82,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
1644 if (table[i].exists) {
1645 _cleanup_free_ char *p = NULL;
1646
1647- p = strjoin(s, "/", table[i].exists, NULL);
1648+ p = strjoin(s, "/", table[i].exists);
1649 if (!p)
1650 return log_oom();
1651
1652diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
1653index bb90c89cc2..3b8768b9a7 100644
1654--- a/src/shared/bus-util.c
1655+++ b/src/shared/bus-util.c
1656@@ -676,7 +676,7 @@ int bus_connect_user_systemd(sd_bus **_bus) {
1657 if (r < 0)
1658 return r;
1659
1660- bus->address = strjoin("unix:path=", ee, "/systemd/private", NULL);
1661+ bus->address = strjoin("unix:path=", ee, "/systemd/private");
1662 if (!bus->address)
1663 return -ENOMEM;
1664
1665@@ -1460,7 +1460,7 @@ int bus_path_encode_unique(sd_bus *b, const char *prefix, const char *sender_id,
1666 if (!external_label)
1667 return -ENOMEM;
1668
1669- p = strjoin(prefix, "/", sender_label, "/", external_label, NULL);
1670+ p = strjoin(prefix, "/", sender_label, "/", external_label);
1671 if (!p)
1672 return -ENOMEM;
1673
1674diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c
1675index 3e451db715..4db6cefb6e 100644
1676--- a/src/shared/cgroup-show.c
1677+++ b/src/shared/cgroup-show.c
1678@@ -158,7 +158,7 @@ int show_cgroup_by_path(
1679 while ((r = cg_read_subgroup(d, &gn)) > 0) {
1680 _cleanup_free_ char *k = NULL;
1681
1682- k = strjoin(fn, "/", gn, NULL);
1683+ k = strjoin(fn, "/", gn);
1684 free(gn);
1685 if (!k)
1686 return -ENOMEM;
1687diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
1688index 2ec0155b71..19a371c865 100644
1689--- a/src/shared/conf-parser.c
1690+++ b/src/shared/conf-parser.c
1691@@ -101,7 +101,7 @@ int config_item_perf_lookup(
1692 else {
1693 char *key;
1694
1695- key = strjoin(section, ".", lvalue, NULL);
1696+ key = strjoin(section, ".", lvalue);
1697 if (!key)
1698 return -ENOMEM;
1699
1700diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c
1701index 892f0aadf5..f9a6fd5f03 100644
1702--- a/src/shared/dns-domain.c
1703+++ b/src/shared/dns-domain.c
1704@@ -1076,7 +1076,7 @@ int dns_service_split(const char *joined, char **_name, char **_type, char **_do
1705 if (!name)
1706 return -ENOMEM;
1707
1708- type = strjoin(b, ".", c, NULL);
1709+ type = strjoin(b, ".", c);
1710 if (!type)
1711 return -ENOMEM;
1712
1713@@ -1090,7 +1090,7 @@ int dns_service_split(const char *joined, char **_name, char **_type, char **_do
1714
1715 name = NULL;
1716
1717- type = strjoin(a, ".", b, NULL);
1718+ type = strjoin(a, ".", b);
1719 if (!type)
1720 return -ENOMEM;
1721
1722diff --git a/src/shared/dropin.c b/src/shared/dropin.c
1723index b9cd952ac8..2c1cd84df5 100644
1724--- a/src/shared/dropin.c
1725+++ b/src/shared/dropin.c
1726@@ -61,11 +61,11 @@ int drop_in_file(const char *dir, const char *unit, unsigned level,
1727 if (!filename_is_valid(b))
1728 return -EINVAL;
1729
1730- p = strjoin(dir, "/", unit, ".d", NULL);
1731+ p = strjoin(dir, "/", unit, ".d");
1732 if (!p)
1733 return -ENOMEM;
1734
1735- q = strjoin(p, "/", prefix, "-", b, ".conf", NULL);
1736+ q = strjoin(p, "/", prefix, "-", b, ".conf");
1737 if (!q) {
1738 free(p);
1739 return -ENOMEM;
1740@@ -163,7 +163,7 @@ static int iterate_dir(
1741 if (hidden_or_backup_file(de->d_name))
1742 continue;
1743
1744- f = strjoin(path, "/", de->d_name, NULL);
1745+ f = strjoin(path, "/", de->d_name);
1746 if (!f)
1747 return log_oom();
1748
1749@@ -192,7 +192,7 @@ int unit_file_process_dir(
1750 assert(name);
1751 assert(suffix);
1752
1753- path = strjoin(unit_path, "/", name, suffix, NULL);
1754+ path = strjoin(unit_path, "/", name, suffix);
1755 if (!path)
1756 return log_oom();
1757
1758@@ -207,7 +207,7 @@ int unit_file_process_dir(
1759 if (r < 0)
1760 return log_error_errno(r, "Failed to generate template from unit name: %m");
1761
1762- p = strjoin(unit_path, "/", template, suffix, NULL);
1763+ p = strjoin(unit_path, "/", template, suffix);
1764 if (!p)
1765 return log_oom();
1766
1767diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c
1768index a4e0cd3267..f0bfb30bb5 100644
1769--- a/src/shared/fstab-util.c
1770+++ b/src/shared/fstab-util.c
1771@@ -241,7 +241,7 @@ static char *tag_to_udev_node(const char *tagvalue, const char *by) {
1772 if (encode_devnode_name(u, t, enc_len) < 0)
1773 return NULL;
1774
1775- return strjoin("/dev/disk/by-", by, "/", t, NULL);
1776+ return strjoin("/dev/disk/by-", by, "/", t);
1777 }
1778
1779 char *fstab_node_to_udev_node(const char *p) {
1780diff --git a/src/shared/install-printf.c b/src/shared/install-printf.c
1781index cbdf66827f..007c632f35 100644
1782--- a/src/shared/install-printf.c
1783+++ b/src/shared/install-printf.c
1784@@ -45,7 +45,7 @@ static int specifier_prefix_and_instance(char specifier, void *data, void *userd
1785 if (endswith(prefix, "@") && i->default_instance) {
1786 char *ans;
1787
1788- ans = strjoin(prefix, i->default_instance, NULL);
1789+ ans = strjoin(prefix, i->default_instance);
1790 if (!ans)
1791 return -ENOMEM;
1792 *ret = ans;
1793diff --git a/src/shared/install.c b/src/shared/install.c
1794index 0bb47ac527..379d61f976 100644
1795--- a/src/shared/install.c
1796+++ b/src/shared/install.c
1797@@ -1307,7 +1307,7 @@ static int unit_file_search(
1798 STRV_FOREACH(p, paths->search_path) {
1799 _cleanup_free_ char *path = NULL;
1800
1801- path = strjoin(*p, "/", info->name, NULL);
1802+ path = strjoin(*p, "/", info->name);
1803 if (!path)
1804 return -ENOMEM;
1805
1806@@ -1332,7 +1332,7 @@ static int unit_file_search(
1807 STRV_FOREACH(p, paths->search_path) {
1808 _cleanup_free_ char *path = NULL;
1809
1810- path = strjoin(*p, "/", template, NULL);
1811+ path = strjoin(*p, "/", template);
1812 if (!path)
1813 return -ENOMEM;
1814
1815@@ -1612,7 +1612,7 @@ static int install_info_symlink_wants(
1816 continue;
1817 }
1818
1819- path = strjoin(config_path, "/", dst, suffix, n, NULL);
1820+ path = strjoin(config_path, "/", dst, suffix, n);
1821 if (!path)
1822 return -ENOMEM;
1823
1824@@ -1646,7 +1646,7 @@ static int install_info_symlink_link(
1825 if (r > 0)
1826 return 0;
1827
1828- path = strjoin(config_path, "/", i->name, NULL);
1829+ path = strjoin(config_path, "/", i->name);
1830 if (!path)
1831 return -ENOMEM;
1832
1833@@ -2174,7 +2174,7 @@ int unit_file_revert(
1834 STRV_FOREACH(j, fs) {
1835 _cleanup_free_ char *t = NULL;
1836
1837- t = strjoin(*i, "/", *j, NULL);
1838+ t = strjoin(*i, "/", *j);
1839 if (!t)
1840 return -ENOMEM;
1841
1842diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c
1843index 060f8d50c7..6414ba5246 100644
1844--- a/src/shared/machine-image.c
1845+++ b/src/shared/machine-image.c
1846@@ -131,7 +131,7 @@ static int image_new(
1847 return -ENOMEM;
1848
1849 if (path)
1850- i->path = strjoin(path, "/", filename, NULL);
1851+ i->path = strjoin(path, "/", filename);
1852 else
1853 i->path = strdup(filename);
1854
1855diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c
1856index 862096ae7b..a23d09967e 100644
1857--- a/src/shared/path-lookup.c
1858+++ b/src/shared/path-lookup.c
1859@@ -70,7 +70,7 @@ static int user_config_dir(char **ret, const char *suffix) {
1860 if (!home)
1861 return -ENXIO;
1862
1863- j = strjoin(home, "/.config", suffix, NULL);
1864+ j = strjoin(home, "/.config", suffix);
1865 }
1866
1867 if (!j)
1868@@ -102,7 +102,7 @@ static int user_data_dir(char **ret, const char *suffix) {
1869 return -ENXIO;
1870
1871
1872- j = strjoin(home, "/.local/share", suffix, NULL);
1873+ j = strjoin(home, "/.local/share", suffix);
1874 }
1875 if (!j)
1876 return -ENOMEM;
1877diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
1878index 1a4a201740..b598a2a19d 100644
1879--- a/src/systemctl/systemctl.c
1880+++ b/src/systemctl/systemctl.c
1881@@ -529,7 +529,7 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) {
1882 }
1883
1884 if (u->machine) {
1885- j = strjoin(u->machine, ":", u->id, NULL);
1886+ j = strjoin(u->machine, ":", u->id);
1887 if (!j)
1888 return log_oom();
1889
1890@@ -941,7 +941,7 @@ static int output_sockets_list(struct socket_info *socket_infos, unsigned cs) {
1891 char **a;
1892
1893 if (s->machine) {
1894- j = strjoin(s->machine, ":", s->path, NULL);
1895+ j = strjoin(s->machine, ":", s->path);
1896 if (!j)
1897 return log_oom();
1898 path = j;
1899@@ -1225,7 +1225,7 @@ static int output_timers_list(struct timer_info *timer_infos, unsigned n) {
1900 format_timestamp_relative(trel2, sizeof(trel2), t->last_trigger);
1901
1902 if (t->machine) {
1903- j = strjoin(t->machine, ":", t->id, NULL);
1904+ j = strjoin(t->machine, ":", t->id);
1905 if (!j)
1906 return log_oom();
1907 unit = j;
1908@@ -6528,12 +6528,12 @@ static int get_file_to_edit(
1909 assert(name);
1910 assert(ret_path);
1911
1912- path = strjoin(paths->persistent_config, "/", name, NULL);
1913+ path = strjoin(paths->persistent_config, "/", name);
1914 if (!path)
1915 return log_oom();
1916
1917 if (arg_runtime) {
1918- run = strjoin(paths->runtime_config, "/", name, NULL);
1919+ run = strjoin(paths->runtime_config, "/", name);
1920 if (!run)
1921 return log_oom();
1922 }
1923diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
1924index 212cf7a988..9fde9b1884 100644
1925--- a/src/sysv-generator/sysv-generator.c
1926+++ b/src/sysv-generator/sysv-generator.c
1927@@ -566,7 +566,7 @@ static int load_sysv(SysvStub *s) {
1928 char *d = NULL;
1929
1930 if (chkconfig_description)
1931- d = strjoin(chkconfig_description, " ", j, NULL);
1932+ d = strjoin(chkconfig_description, " ", j);
1933 else
1934 d = strdup(j);
1935 if (!d)
1936@@ -628,7 +628,7 @@ static int load_sysv(SysvStub *s) {
1937 char *d = NULL;
1938
1939 if (long_description)
1940- d = strjoin(long_description, " ", t, NULL);
1941+ d = strjoin(long_description, " ", t);
1942 else
1943 d = strdup(j);
1944 if (!d)
1945@@ -807,7 +807,7 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
1946 continue;
1947 }
1948
1949- fpath = strjoin(*path, "/", de->d_name, NULL);
1950+ fpath = strjoin(*path, "/", de->d_name);
1951 if (!fpath)
1952 return log_oom();
1953
1954@@ -853,7 +853,7 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
1955 _cleanup_free_ char *path = NULL;
1956 struct dirent *de;
1957
1958- path = strjoin(*p, "/", rcnd_table[i].path, NULL);
1959+ path = strjoin(*p, "/", rcnd_table[i].path);
1960 if (!path) {
1961 r = log_oom();
1962 goto finish;
1963@@ -883,7 +883,7 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
1964 if (a < 0 || b < 0)
1965 continue;
1966
1967- fpath = strjoin(*p, "/", de->d_name, NULL);
1968+ fpath = strjoin(*p, "/", de->d_name);
1969 if (!fpath) {
1970 r = log_oom();
1971 goto finish;
1972diff --git a/src/test/test-copy.c b/src/test/test-copy.c
1973index ed1ea51dbd..91e4e5b409 100644
1974--- a/src/test/test-copy.c
1975+++ b/src/test/test-copy.c
1976@@ -141,8 +141,8 @@ static void test_copy_tree(void) {
1977 STRV_FOREACH_PAIR(link, p, links) {
1978 _cleanup_free_ char *target = NULL, *f, *l;
1979
1980- assert_se(f = strjoin(original_dir, *p, NULL));
1981- assert_se(l = strjoin(copy_dir, *link, NULL));
1982+ assert_se(f = strjoin(original_dir, *p));
1983+ assert_se(l = strjoin(copy_dir, *link));
1984
1985 assert_se(readlink_and_canonicalize(l, &target) == 0);
1986 assert_se(path_equal(f, target));
1987diff --git a/src/test/test-date.c b/src/test/test-date.c
1988index 7f497bb7d5..a8d3f1e083 100644
1989--- a/src/test/test-date.c
1990+++ b/src/test/test-date.c
1991@@ -60,7 +60,7 @@ static void test_one(const char *p) {
1992 _cleanup_free_ char *with_utc;
1993
1994 log_info("Test: %s", p);
1995- with_utc = strjoin(p, " UTC", NULL);
1996+ with_utc = strjoin(p, " UTC");
1997 test_should_pass(p);
1998 test_should_pass(with_utc);
1999 }
2000@@ -69,7 +69,7 @@ static void test_one_noutc(const char *p) {
2001 _cleanup_free_ char *with_utc;
2002
2003 log_info("Test: %s", p);
2004- with_utc = strjoin(p, " UTC", NULL);
2005+ with_utc = strjoin(p, " UTC");
2006 test_should_pass(p);
2007 test_should_fail(with_utc);
2008 }
2009diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c
2010index 92663ef66f..56316904a3 100644
2011--- a/src/test/test-fileio.c
2012+++ b/src/test/test-fileio.c
2013@@ -367,7 +367,7 @@ static void test_write_string_file_verify(void) {
2014 int r;
2015
2016 assert_se(read_one_line_file("/proc/cmdline", &buf) >= 0);
2017- assert_se((buf2 = strjoin(buf, "\n", NULL)));
2018+ assert_se((buf2 = strjoin(buf, "\n")));
2019
2020 r = write_string_file("/proc/cmdline", buf, 0);
2021 assert_se(r == -EACCES || r == -EIO);
2022diff --git a/src/test/test-namespace.c b/src/test/test-namespace.c
2023index ff9f35cecd..de7be1f9cc 100644
2024--- a/src/test/test-namespace.c
2025+++ b/src/test/test-namespace.c
2026@@ -132,14 +132,14 @@ int main(int argc, char *argv[]) {
2027 assert_se(sd_id128_get_boot(&bid) >= 0);
2028 sd_id128_to_string(bid, boot_id);
2029
2030- x = strjoin("/tmp/systemd-private-", boot_id, "-abcd.service-", NULL);
2031- y = strjoin("/var/tmp/systemd-private-", boot_id, "-abcd.service-", NULL);
2032+ x = strjoin("/tmp/systemd-private-", boot_id, "-abcd.service-");
2033+ y = strjoin("/var/tmp/systemd-private-", boot_id, "-abcd.service-");
2034 assert_se(x && y);
2035
2036 test_tmpdir("abcd.service", x, y);
2037
2038- z = strjoin("/tmp/systemd-private-", boot_id, "-sys-devices-pci0000:00-0000:00:1a.0-usb3-3\\x2d1-3\\x2d1:1.0-bluetooth-hci0.device-", NULL);
2039- zz = strjoin("/var/tmp/systemd-private-", boot_id, "-sys-devices-pci0000:00-0000:00:1a.0-usb3-3\\x2d1-3\\x2d1:1.0-bluetooth-hci0.device-", NULL);
2040+ z = strjoin("/tmp/systemd-private-", boot_id, "-sys-devices-pci0000:00-0000:00:1a.0-usb3-3\\x2d1-3\\x2d1:1.0-bluetooth-hci0.device-");
2041+ zz = strjoin("/var/tmp/systemd-private-", boot_id, "-sys-devices-pci0000:00-0000:00:1a.0-usb3-3\\x2d1-3\\x2d1:1.0-bluetooth-hci0.device-");
2042
2043 assert_se(z && zz);
2044
2045diff --git a/src/test/test-path.c b/src/test/test-path.c
2046index 4d3f0e9948..5e99d478ee 100644
2047--- a/src/test/test-path.c
2048+++ b/src/test/test-path.c
2049@@ -56,7 +56,7 @@ static int setup_test(Manager **m) {
2050 STRV_FOREACH(test_path, tests_path) {
2051 _cleanup_free_ char *p = NULL;
2052
2053- p = strjoin("/tmp/test-path_", *test_path, NULL);
2054+ p = strjoin("/tmp/test-path_", *test_path);
2055 assert_se(p);
2056
2057 (void) rm_rf(p, REMOVE_ROOT|REMOVE_PHYSICAL);
2058diff --git a/src/test/test-replace-var.c b/src/test/test-replace-var.c
2059index 297effce79..60e05d04c9 100644
2060--- a/src/test/test-replace-var.c
2061+++ b/src/test/test-replace-var.c
2062@@ -25,7 +25,7 @@
2063 #include "util.h"
2064
2065 static char *lookup(const char *variable, void *userdata) {
2066- return strjoin("<<<", variable, ">>>", NULL);
2067+ return strjoin("<<<", variable, ">>>");
2068 }
2069
2070 int main(int argc, char *argv[]) {
2071diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
2072index 954f4aa985..97a564d5a2 100644
2073--- a/src/tmpfiles/tmpfiles.c
2074+++ b/src/tmpfiles/tmpfiles.c
2075@@ -422,7 +422,7 @@ static int dir_cleanup(
2076 continue;
2077 }
2078
2079- sub_path = strjoin(p, "/", dent->d_name, NULL);
2080+ sub_path = strjoin(p, "/", dent->d_name);
2081 if (!sub_path) {
2082 r = log_oom();
2083 goto finish;
2084@@ -1082,7 +1082,7 @@ static int item_do_children(Item *i, const char *path, action_t action) {
2085 if (STR_IN_SET(de->d_name, ".", ".."))
2086 continue;
2087
2088- p = strjoin(path, "/", de->d_name, NULL);
2089+ p = strjoin(path, "/", de->d_name);
2090 if (!p)
2091 return -ENOMEM;
2092
2093diff --git a/src/udev/udev-builtin-hwdb.c b/src/udev/udev-builtin-hwdb.c
2094index f4a065a97d..acd1d1a6de 100644
2095--- a/src/udev/udev-builtin-hwdb.c
2096+++ b/src/udev/udev-builtin-hwdb.c
2097@@ -43,7 +43,7 @@ int udev_builtin_hwdb_lookup(struct udev_device *dev,
2098 return -ENOENT;
2099
2100 if (prefix) {
2101- lookup = strjoin(prefix, modalias, NULL);
2102+ lookup = strjoin(prefix, modalias);
2103 if (!lookup)
2104 return -ENOMEM;
2105 modalias = lookup;
2106diff --git a/src/udev/udevadm-hwdb.c b/