]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
manager: replace fake block with a strjoina
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 10 Oct 2018 11:27:28 +0000 (13:27 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 11 Oct 2018 12:29:34 +0000 (14:29 +0200)
The block was created to avoid declaring variables in the middle of the block.
We could now do that, but it's easier to just use strjoina here.

src/core/manager.c

index 2dea89dc01f6b28c273d410a9ec77a581ade69a0..e9f73654f102789c8bde369025619c2a6887c1f0 100644 (file)
@@ -3112,11 +3112,8 @@ int manager_serialize(
                         continue;
 
                 t = manager_timestamp_to_string(q);
-                {
-                        char field[strlen(t) + STRLEN("-timestamp") + 1];
-                        strcpy(stpcpy(field, t), "-timestamp");
-                        dual_timestamp_serialize(f, field, m->timestamps + q);
-                }
+                const char *field = strjoina(t, "-timestamp");
+                dual_timestamp_serialize(f, field, m->timestamps + q);
         }
 
         if (!switching_root)