initctl: minor, fix invalid format string for print_header()

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-05-17 14:33:45 +02:00
parent c39106906d
commit 0de5981948
+7 -15
View File
@@ -374,13 +374,9 @@ static int dump_one_cond(const char *fpath, const struct stat *sb, int tflag, st
static int do_cond_dump(char *arg)
{
col_widths();
if (heading) {
char title[80];
snprintf(title, sizeof(title), "%-*s %-*s %-6s %s", pw, "PID",
iw, "IDENT", "STATUS", "CONDITION");
print_header(title);
}
if (heading)
print_header("%-*s %-*s %-6s %s", pw, "PID", iw, "IDENT",
"STATUS", "CONDITION");
if (nftw(_PATH_COND, dump_one_cond, 20, 0) == -1) {
WARNX("Failed parsing %s", _PATH_COND);
@@ -497,13 +493,9 @@ static int do_cond_show(char *arg)
svc_t *svc;
col_widths();
if (heading) {
char title[80];
snprintf(title, sizeof(title), "%-*s %-*s %-6s %s", pw, "PID",
iw, "IDENT", "STATUS", "CONDITION (+ ON, ~ FLUX, - OFF)");
print_header(title);
}
if (heading)
print_header("%-*s %-*s %-6s %s", pw, "PID", iw, "IDENT",
"STATUS", "CONDITION (+ ON, ~ FLUX, - OFF)");
for (svc = client_svc_iterator(1); svc; svc = client_svc_iterator(0)) {
if (!svc->cond[0])
@@ -883,7 +875,7 @@ static int show_status(char *arg)
else
strlcat(title, "COMMAND", sizeof(title));
print_header(title);
print_header("%s", title);
}
for (svc = client_svc_iterator(1); svc; svc = client_svc_iterator(0)) {