diff --git a/src/core/show-status.c b/src/core/show-status.c index 606237ee0ea..81b6b23fd7d 100644 --- a/src/core/show-status.c +++ b/src/core/show-status.c @@ -38,11 +38,12 @@ int parse_show_status(const char *v, ShowStatus *ret) { int status_vprintf(const char *status, ShowStatusFlags flags, const char *format, va_list ap) { static const char status_indent[] = " "; /* "[" STATUS "] " */ + static bool prev_ephemeral = false; + _cleanup_free_ char *s = NULL; _cleanup_close_ int fd = -EBADF; struct iovec iovec[7] = {}; int n = 0; - static bool prev_ephemeral; assert(format); @@ -70,7 +71,7 @@ int status_vprintf(const char *status, ShowStatusFlags flags, const char *format if (c <= 0) c = 80; - sl = status ? sizeof(status_indent)-1 : 0; + sl = status ? strlen(status_indent) : 0; emax = c - sl - 1; if (emax < 3)