X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Funit.c;h=56102b360d13cd8a34c4381251295ac3030bfcb1;hp=08e74b416061f055f1a51ec0a2400f04337df266;hb=4c94096027f21d4ed0efe991534a926d39d52369;hpb=5ed1227238724959f020169f5332086439709b55 diff --git a/src/core/unit.c b/src/core/unit.c index 08e74b416..56102b360 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -791,7 +791,6 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) { char *t, **j; UnitDependency d; Iterator i; - _cleanup_free_ char *p2 = NULL; const char *prefix2; char timestamp1[FORMAT_TIMESTAMP_MAX], @@ -806,10 +805,8 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) { assert(u); assert(u->type >= 0); - if (!prefix) - prefix = ""; - p2 = strappend(prefix, "\t"); - prefix2 = p2 ? p2 : prefix; + prefix = strempty(prefix); + prefix2 = strappenda(prefix, "\t"); fprintf(f, "%s-> Unit %s:\n"