X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=imap-send.c;h=de8114bac010ef095cf9de17671566e248366dcb;hb=a689faeb5850174edfbbb0a502ef7eee8cd06d76;hp=834301cf409c311d47b22a0f7504917a32847647;hpb=c50230f75109677d7adf0bd94f99d17f35a519a6;p=git.git 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 < "; 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; }