aboutsummaryrefslogtreecommitdiffstats
path: root/imap-send.c
diff options
context:
space:
mode:
authorTarmigan Casebolt <tarmigan+git@gmail.com>2009-11-14 13:33:13 -0800
committerJunio C Hamano <gitster@pobox.com>2009-11-15 18:24:58 -0800
commit28bea9e53481fddcb12e63d8c049f0ff2917a573 (patch)
tree1f38ad659ae1b5af3ae05b788c4b6bebb49961f5 /imap-send.c
parent77097faa5dc3da2947f4a4bdb6f8a7766f4ef89a (diff)
downloadgit-28bea9e53481fddcb12e63d8c049f0ff2917a573.tar.gz
Check the format of more printf-type functions
We already have these checks in many printf-type functions that have prototypes which are in header files. Add these same checks to some more prototypes in header functions and to static functions in .c files. cc: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'imap-send.c')
-rw-r--r--imap-send.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/imap-send.c b/imap-send.c
index f805c6ed81..57a3c65dda 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -100,13 +100,16 @@ struct msg_data {
static int Verbose, Quiet;
+__attribute__((format (printf, 1, 2)))
static void imap_info(const char *, ...);
+__attribute__((format (printf, 1, 2)))
static void imap_warn(const char *, ...);
static char *next_arg(char **);
static void free_generic_messages(struct message *);
+__attribute__((format (printf, 3, 4)))
static int nfsnprintf(char *buf, int blen, const char *fmt, ...);
static int nfvasprintf(char **strp, const char *fmt, va_list ap)
@@ -600,6 +603,7 @@ static struct imap_cmd *v_issue_imap_cmd(struct imap_store *ctx,
return cmd;
}
+__attribute__((format (printf, 3, 4)))
static struct imap_cmd *issue_imap_cmd(struct imap_store *ctx,
struct imap_cmd_cb *cb,
const char *fmt, ...)
@@ -613,6 +617,7 @@ static struct imap_cmd *issue_imap_cmd(struct imap_store *ctx,
return ret;
}
+__attribute__((format (printf, 3, 4)))
static int imap_exec(struct imap_store *ctx, struct imap_cmd_cb *cb,
const char *fmt, ...)
{
@@ -628,6 +633,7 @@ static int imap_exec(struct imap_store *ctx, struct imap_cmd_cb *cb,
return get_cmd_result(ctx, cmdp);
}
+__attribute__((format (printf, 3, 4)))
static int imap_exec_m(struct imap_store *ctx, struct imap_cmd_cb *cb,
const char *fmt, ...)
{
@@ -918,7 +924,7 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
if (!strcmp("NO", arg)) {
if (cmdp->cb.create && cmd && (cmdp->cb.trycreate || !memcmp(cmd, "[TRYCREATE]", 11))) { /* SELECT, APPEND or UID COPY */
p = strchr(cmdp->cmd, '"');
- if (!issue_imap_cmd(ctx, NULL, "CREATE \"%.*s\"", strchr(p + 1, '"') - p + 1, p)) {
+ if (!issue_imap_cmd(ctx, NULL, "CREATE \"%.*s\"", (int)(strchr(p + 1, '"') - p + 1), p)) {
resp = RESP_BAD;
goto normal;
}