We don't use sizeof() outside of array definitions
these days. The compiler should be capable of
optimizing this out.
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);
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)