aboutsummaryrefslogtreecommitdiff
path: root/imap-send.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-11-22 16:28:14 -0800
committerJunio C Hamano <gitster@pobox.com>2009-11-22 16:28:14 -0800
commit82f05d5dd7ec54c4cd30f016c4380b21245e0d63 (patch)
treec81b46f0c28579c06b886074149e9762921a3ddc /imap-send.c
parentc50230f75109677d7adf0bd94f99d17f35a519a6 (diff)
parent28bea9e53481fddcb12e63d8c049f0ff2917a573 (diff)
downloadgit-82f05d5dd7ec54c4cd30f016c4380b21245e0d63.tar.gz
git-82f05d5dd7ec54c4cd30f016c4380b21245e0d63.tar.xz
Merge branch 'tc/format-attribute'
* tc/format-attribute: Check the format of more printf-type functions
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 834301cf4..de8114bac 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -104,13 +104,16 @@ static const char imap_send_usage[] = "git imap-send < <mbox>";
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)
@@ -562,6 +565,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, ...)
@@ -575,6 +579,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, ...)
{
@@ -590,6 +595,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, ...)
{
@@ -880,7 +886,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;
}