From 4c94096027f21d4ed0efe991534a926d39d52369 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 21 Aug 2014 16:15:49 +0200 Subject: core: unify how we generate the prefix string when dumping unit state --- src/core/unit.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/core/unit.c') diff --git a/src/core/unit.c b/src/core/unit.c index 08e74b4160..56102b360d 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" -- cgit v1.2.3-54-g00ecf