X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=imap-send.c;h=71506a8dd3ed07fe44c487a644ce9a42b94a7578;hb=cfb5e6b2da96c7803aa4a3813d27d2cbb47cda9e;hp=9d0097ca02960460ff3a104f1739982fee453987;hpb=bd01c6de67715586f7527115bb4f74e7929b3b66;p=thirdparty%2Fgit.git diff --git a/imap-send.c b/imap-send.c index 9d0097ca02..71506a8dd3 100644 --- a/imap-send.c +++ b/imap-send.c @@ -230,7 +230,7 @@ enum CAPABILITY { LITERALPLUS, NAMESPACE, STARTTLS, - AUTH_CRAM_MD5, + AUTH_CRAM_MD5 }; static const char *cap_list[] = { @@ -543,9 +543,13 @@ static struct imap_cmd *v_issue_imap_cmd(struct imap_store *ctx, while (imap->literal_pending) get_cmd_result(ctx, NULL); - bufl = nfsnprintf(buf, sizeof(buf), cmd->cb.data ? CAP(LITERALPLUS) ? - "%d %s{%d+}\r\n" : "%d %s{%d}\r\n" : "%d %s\r\n", - cmd->tag, cmd->cmd, cmd->cb.dlen); + if (!cmd->cb.data) + bufl = nfsnprintf(buf, sizeof(buf), "%d %s\r\n", cmd->tag, cmd->cmd); + else + bufl = nfsnprintf(buf, sizeof(buf), "%d %s{%d%s}\r\n", + cmd->tag, cmd->cmd, cmd->cb.dlen, + CAP(LITERALPLUS) ? "+" : ""); + if (Verbose) { if (imap->num_in_progress) printf("(%d in progress) ", imap->num_in_progress); @@ -1086,7 +1090,7 @@ static struct store *imap_open_store(struct imap_server_conf *srvc) int gai; char portstr[6]; - snprintf(portstr, sizeof(portstr), "%hu", srvc->port); + snprintf(portstr, sizeof(portstr), "%d", srvc->port); memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_STREAM;