From: Zbigniew Jędrzejewski-Szmek Date: Wed, 10 Oct 2018 11:27:28 +0000 (+0200) Subject: manager: replace fake block with a strjoina X-Git-Tag: v240~576^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d7cf7207017f308b6992d4776c6de56e1d6910c;p=thirdparty%2Fsystemd.git manager: replace fake block with a strjoina 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. --- diff --git a/src/core/manager.c b/src/core/manager.c index 2dea89dc01f..e9f73654f10 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -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)