summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-11-20 18:11:37 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-11-20 18:11:37 +0000
commitc0572ea9929b86071dcce6d7a9616164c6450d71 (patch)
tree402349a123be43fb9ce8f2f381c8589d752ff456
parentb04bffc9c99045776abea011cc95f5819a939872 (diff)
Fix a format string bug and sprinkle some printflikes.
-rw-r--r--CHANGES4
-rw-r--r--key-bindings.c12
-rw-r--r--server-fn.c4
-rw-r--r--server-msg.c14
-rw-r--r--status.c6
-rw-r--r--tmux.h4
6 files changed, 24 insertions, 20 deletions
diff --git a/CHANGES b/CHANGES
index f4c01dee..a4001560 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
20 November 2007
+* Fix format string error with "must specify a client" message. Also
+ sprinkle some printflike tags.
* tmux 0.1 released.
17 November 2007
@@ -231,4 +233,4 @@
(including mutt, emacs). No status bar yet and no key remapping or other
customisation.
-$Id: CHANGES,v 1.74 2007-11-20 17:01:38 nicm Exp $
+$Id: CHANGES,v 1.75 2007-11-20 18:11:37 nicm Exp $
diff --git a/key-bindings.c b/key-bindings.c
index 6f165eaa..7be5df60 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -1,4 +1,4 @@
-/* $Id: key-bindings.c,v 1.15 2007-11-16 22:06:45 nicm Exp $ */
+/* $Id: key-bindings.c,v 1.16 2007-11-20 18:11:37 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -26,8 +26,8 @@
struct bindings key_bindings;
-void key_bindings_error(struct cmd_ctx *, const char *, ...);
-void key_bindings_print(struct cmd_ctx *, const char *, ...);
+void printflike2 key_bindings_error(struct cmd_ctx *, const char *, ...);
+void printflike2 key_bindings_print(struct cmd_ctx *, const char *, ...);
void
key_bindings_add(int key, struct cmd *cmd)
@@ -141,7 +141,7 @@ key_bindings_free(void)
ARRAY_FREE(&key_bindings);
}
-void
+void printflike2
key_bindings_error(struct cmd_ctx *ctx, const char *fmt, ...)
{
va_list ap;
@@ -152,11 +152,11 @@ key_bindings_error(struct cmd_ctx *ctx, const char *fmt, ...)
va_end(ap);
*msg = toupper((u_char) *msg);
- server_write_message(ctx->client, msg);
+ server_write_message(ctx->client, "%s", msg);
xfree(msg);
}
-void
+void printflike2
key_bindings_print(struct cmd_ctx *ctx, const char *fmt, ...)
{
static u_int line;
diff --git a/server-fn.c b/server-fn.c
index a04b181c..68ebc374 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -1,4 +1,4 @@
-/* $Id: server-fn.c,v 1.24 2007-10-30 10:59:43 nicm Exp $ */
+/* $Id: server-fn.c,v 1.25 2007-11-20 18:11:37 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -327,7 +327,7 @@ server_status_window_all(struct window *w)
}
}
-void
+void printflike2
server_write_message(struct client *c, const char *fmt, ...)
{
struct screen *s = &c->session->curw->window->screen;
diff --git a/server-msg.c b/server-msg.c
index 3af04de8..329bfb3e 100644
--- a/server-msg.c
+++ b/server-msg.c
@@ -1,4 +1,4 @@
-/* $Id: server-msg.c,v 1.32 2007-11-16 21:31:03 nicm Exp $ */
+/* $Id: server-msg.c,v 1.33 2007-11-20 18:11:37 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -29,8 +29,10 @@ int server_msg_fn_identify(struct hdr *, struct client *);
int server_msg_fn_keys(struct hdr *, struct client *);
int server_msg_fn_resize(struct hdr *, struct client *);
-void server_msg_fn_command_error(struct cmd_ctx *, const char *, ...);
-void server_msg_fn_command_print(struct cmd_ctx *, const char *, ...);
+void printflike2 server_msg_fn_command_error(
+ struct cmd_ctx *, const char *, ...);
+void printflike2 server_msg_fn_command_print(
+ struct cmd_ctx *, const char *, ...);
struct server_msg {
enum hdrtype type;
@@ -74,7 +76,7 @@ server_msg_dispatch(struct client *c)
}
}
-void
+void printflike2
server_msg_fn_command_error(struct cmd_ctx *ctx, const char *fmt, ...)
{
va_list ap;
@@ -88,7 +90,7 @@ server_msg_fn_command_error(struct cmd_ctx *ctx, const char *fmt, ...)
xfree(msg);
}
-void
+void printflike2
server_msg_fn_command_print(struct cmd_ctx *ctx, const char *fmt, ...)
{
va_list ap;
@@ -144,7 +146,7 @@ server_msg_fn_command(struct hdr *hdr, struct client *c)
} else {
if (client == NULL) {
server_msg_fn_command_error(&ctx,
- "%s: must specify a client: %s", cmd->entry->name);
+ "%s: must specify a client", cmd->entry->name);
goto out;
}
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
diff --git a/status.c b/status.c
index ad0ef1b2..90a2363e 100644
--- a/status.c
+++ b/status.c
@@ -1,4 +1,4 @@
-/* $Id: status.c,v 1.8 2007-10-30 10:59:43 nicm Exp $ */
+/* $Id: status.c,v 1.9 2007-11-20 18:11:37 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -22,7 +22,7 @@
#include "tmux.h"
-void status_print(struct buffer *, size_t *, const char *, ...);
+void printflike3 status_print(struct buffer *, size_t *, const char *, ...);
void
status_write(struct client *c)
@@ -61,7 +61,7 @@ status_write(struct client *c)
input_store_zero(b, CODE_CURSORON);
}
-void
+void printflike3
status_print(struct buffer *b, size_t *size, const char *fmt, ...)
{
va_list ap;
diff --git a/tmux.h b/tmux.h
index 289fa582..ebbc37cd 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1,4 +1,4 @@
-/* $Id: tmux.h,v 1.81 2007-11-16 21:31:03 nicm Exp $ */
+/* $Id: tmux.h,v 1.82 2007-11-20 18:11:37 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -653,7 +653,7 @@ void server_clear_window_cur(struct window *);
void server_clear_window_all(struct window *);
void server_redraw_window_cur(struct window *);
void server_redraw_window_all(struct window *);
-void server_write_message(struct client *, const char *, ...);
+void printflike2 server_write_message(struct client *, const char *, ...);
/* status.c */
void status_write(struct client *c);