From dc6271cd79947c020fc21a9d5641de6d576f61f2 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 18 Aug 2009 14:48:42 +0000 Subject: [PATCH] Tag a few missed printf-like functions and fix a missing "%s". --- cmd-server-info.c | 8 ++++---- cmd-show-buffer.c | 2 +- tmux.h | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd-server-info.c b/cmd-server-info.c index 396d15b0..daa08572 100644 --- a/cmd-server-info.c +++ b/cmd-server-info.c @@ -81,7 +81,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx) ctx->print(ctx, "protocol version is %d", PROTOCOL_VERSION); ctx->print(ctx, "%u clients, %u sessions", ARRAY_LENGTH(&clients), ARRAY_LENGTH(&sessions)); - ctx->print(ctx, ""); + ctx->print(ctx, "%s", ""); ctx->print(ctx, "Clients:"); for (i = 0; i < ARRAY_LENGTH(&clients); i++) { @@ -94,7 +94,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx) c->session->name, c->tty.sx, c->tty.sy, c->tty.termname, c->flags, c->tty.flags); } - ctx->print(ctx, ""); + ctx->print(ctx, "%s", ""); ctx->print(ctx, "Sessions: [%zu/%zu]", sizeof (struct grid_cell), sizeof (struct grid_utf8)); @@ -142,7 +142,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx) } } } - ctx->print(ctx, ""); + ctx->print(ctx, "%s", ""); ctx->print(ctx, "Terminals:"); SLIST_FOREACH(term, &tty_terms, entry) { @@ -174,7 +174,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx) } } } - ctx->print(ctx, ""); + ctx->print(ctx, "%s", ""); return (0); } diff --git a/cmd-show-buffer.c b/cmd-show-buffer.c index 0b525695..8972f098 100644 --- a/cmd-show-buffer.c +++ b/cmd-show-buffer.c @@ -94,7 +94,7 @@ cmd_show_buffer_exec(struct cmd *self, struct cmd_ctx *ctx) if (len != 0) { buf[len] = '\0'; - ctx->print(ctx, buf); + ctx->print(ctx, "%s", buf); } xfree(buf); diff --git a/tmux.h b/tmux.h index 4ba1cec4..4aa844b8 100644 --- a/tmux.h +++ b/tmux.h @@ -991,9 +991,9 @@ struct cmd_ctx { struct msg_command_data *msgdata; - void (*print)(struct cmd_ctx *, const char *, ...); - void (*info)(struct cmd_ctx *, const char *, ...); - void (*error)(struct cmd_ctx *, const char *, ...); + void printflike2 (*print)(struct cmd_ctx *, const char *, ...); + void printflike2 (*info)(struct cmd_ctx *, const char *, ...); + void printflike2 (*error)(struct cmd_ctx *, const char *, ...); }; struct cmd { @@ -1722,8 +1722,8 @@ void printflike1 log_warnx(const char *, ...); void printflike1 log_info(const char *, ...); void printflike1 log_debug(const char *, ...); void printflike1 log_debug2(const char *, ...); -__dead void log_fatal(const char *, ...); -__dead void log_fatalx(const char *, ...); +__dead void printflike1 log_fatal(const char *, ...); +__dead void printflike1 log_fatalx(const char *, ...); /* xmalloc.c */ char *xstrdup(const char *);