From: Thomas Roessler Date: Mon, 10 Jul 2000 10:34:56 +0000 (+0000) Subject: Fix a bunch of cases where format parameters were missing from calls X-Git-Tag: mutt-1-3-6-rel~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0f8b0470cbc3707993db02a81f4356e294adcf1;p=mutt Fix a bunch of cases where format parameters were missing from calls to mutt_message and mutt_error. --- diff --git a/browser.c b/browser.c index 9adee806..0e0c319c 100644 --- a/browser.c +++ b/browser.c @@ -791,7 +791,7 @@ void _mutt_select_file (char *f, size_t flen, int buffy, case OP_BROWSER_TELL: if(state.entrylen) - mutt_message(state.entry[menu->current].name); + mutt_message("%s", state.entry[menu->current].name); break; #ifdef USE_IMAP diff --git a/imap/command.c b/imap/command.c index 97763670..722b3973 100644 --- a/imap/command.c +++ b/imap/command.c @@ -150,7 +150,7 @@ int imap_exec (char* buf, size_t buflen, IMAP_DATA* idata, const char* cmd, pc = buf + SEQLEN; SKIPWS (pc); pc = imap_next_word (pc); - mutt_error (pc); + mutt_error ("%s", pc); sleep (1); return -1; @@ -258,7 +258,7 @@ int imap_handle_untagged (IMAP_DATA *idata, char *s) /* server shut down our connection */ s += 3; SKIPWS (s); - mutt_error (s); + mutt_error ("%s", s); idata->status = IMAP_BYE; if (idata->state == IMAP_SELECTED) mx_fastclose_mailbox (idata->selected_ctx); @@ -270,7 +270,7 @@ int imap_handle_untagged (IMAP_DATA *idata, char *s) else if (option (OPTIMAPSERVERNOISE) && (mutt_strncasecmp ("NO", s, 2) == 0)) { /* Display the warning message from the server */ - mutt_error (s+3); + mutt_error ("%s", s+3); sleep (1); } else diff --git a/imap/imap.c b/imap/imap.c index 7ca19053..b4015a11 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -247,7 +247,7 @@ int imap_reopen_mailbox (CONTEXT *ctx, int *index_hint) char *s; s = imap_next_word (buf); /* skip seq */ s = imap_next_word (s); /* Skip response */ - mutt_error (s); + mutt_error ("%s", s); sleep (1); return -1; } @@ -674,7 +674,7 @@ int imap_open_mailbox (CONTEXT *ctx) char *s; s = imap_next_word (buf); /* skip seq */ s = imap_next_word (s); /* Skip response */ - mutt_error (s); + mutt_error ("%s", s); idata->state = IMAP_AUTHENTICATED; sleep (1); return -1; @@ -978,9 +978,7 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge, int *index_hint) /* if we have a message set, then let's delete */ if (deleted) { - snprintf (tmp, sizeof (tmp), _("Marking %d messages deleted..."), - deleted); - mutt_message (tmp); + mutt_message (_("Marking %d messages deleted..."), deleted); snprintf (tmp, sizeof (tmp), "STORE %s +FLAGS.SILENT (\\Deleted)", buf); if (imap_exec (buf, sizeof (buf), CTX_DATA, tmp, 0) != 0) /* continue, let regular store try before giving up */ @@ -998,9 +996,7 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge, int *index_hint) { if (ctx->hdrs[n]->changed) { - snprintf (buf, sizeof (buf), _("Saving message status flags... [%d/%d]"), - n+1, ctx->msgcount); - mutt_message (buf); + mutt_message (_("Saving message status flags... [%d/%d]"), n+1, ctx->msgcount); flags[0] = '\0'; diff --git a/imap/message.c b/imap/message.c index c6b46b7f..bf332f7b 100644 --- a/imap/message.c +++ b/imap/message.c @@ -92,9 +92,8 @@ int imap_read_headers (CONTEXT *ctx, int msgbegin, int msgend) h0 = h; for (msgno = msgbegin; msgno <= msgend ; msgno++) { - snprintf (buf, sizeof (buf), _("Fetching message headers... [%d/%d]"), - msgno + 1, msgend + 1); - mutt_message (buf); + mutt_message (_("Fetching message headers... [%d/%d]"), + msgno + 1, msgend + 1); if (msgno + 1 > fetchlast) { @@ -525,7 +524,7 @@ int imap_append_message (CONTEXT *ctx, MESSAGE *msg) pc = buf + SEQLEN; SKIPWS (pc); pc = imap_next_word (pc); - mutt_error (pc); + mutt_error ("%s", pc); sleep (1); fclose (fp); return (-1); @@ -568,7 +567,7 @@ int imap_append_message (CONTEXT *ctx, MESSAGE *msg) pc = buf + SEQLEN; SKIPWS (pc); pc = imap_next_word (pc); - mutt_error (pc); + mutt_error ("%s", pc); sleep (1); return (-1); } diff --git a/imap/socket.c b/imap/socket.c index d0613156..e752bcf1 100644 --- a/imap/socket.c +++ b/imap/socket.c @@ -160,10 +160,9 @@ void imap_logout_all (void) { if (conn->up) { - snprintf (buf, sizeof (buf), _("Closing connection to %s..."), - conn->mx.host); - mutt_message (buf); - + mutt_message (_("Closing connection to %s..."), + conn->mx.host); + imap_make_sequence (seq, sizeof (seq)); snprintf (buf, sizeof (buf), "%s LOGOUT\r\n", seq); diff --git a/pgpkey.c b/pgpkey.c index 7d769e3c..df7a15c4 100644 --- a/pgpkey.c +++ b/pgpkey.c @@ -514,7 +514,7 @@ static pgp_key_t *pgp_select_key (pgp_key_t *keys, case OP_VIEW_ID: - mutt_message (KeyTable[menu->current]->addr); + mutt_message ("%s", KeyTable[menu->current]->addr); break; case OP_GENERIC_SELECT_ENTRY: diff --git a/pop.c b/pop.c index 6623fa86..2dfe77dc 100644 --- a/pop.c +++ b/pop.c @@ -133,7 +133,7 @@ void mutt_fetchPopMail (void) if (mutt_strncmp (buffer, "+OK", 3) != 0) { mutt_remove_trailing_ws (buffer); - mutt_error (buffer); + mutt_error ("%s", buffer); goto finish; } @@ -146,7 +146,7 @@ void mutt_fetchPopMail (void) if (mutt_strncmp (buffer, "+OK", 3) != 0) { mutt_remove_trailing_ws (buffer); - mutt_error (buffer); + mutt_error ("%s", buffer); goto finish; } @@ -163,7 +163,7 @@ void mutt_fetchPopMail (void) safe_free((void **) &PopPass); /* void the given password */ mutt_remove_trailing_ws (buffer); - mutt_error (buffer[0] ? buffer : _("Server closed connection!")); + mutt_error ("%s", buffer[0] ? buffer : _("Server closed connection!")); goto finish; } @@ -176,7 +176,7 @@ void mutt_fetchPopMail (void) if (mutt_strncmp (buffer, "+OK", 3) != 0) { mutt_remove_trailing_ws (buffer); - mutt_error (buffer); + mutt_error ("%s", buffer); goto finish; } @@ -208,10 +208,8 @@ void mutt_fetchPopMail (void) if (msgs - last) delanswer = query_quadoption(OPT_POPDELETE, _("Delete messages from server?")); - snprintf (msgbuf, sizeof (msgbuf), - msgs > 1 ? _("Reading new messages (%d bytes)...") : + mutt_message (msgs > 1 ? _("Reading new messages (%d bytes)...") : _("Reading new message (%d bytes)..."), bytes); - mutt_message (msgbuf); for (i = last + 1 ; i <= msgs ; i++) { @@ -227,7 +225,7 @@ void mutt_fetchPopMail (void) if (mutt_strncmp (buffer, "+OK", 3) != 0) { mutt_remove_trailing_ws (buffer); - mutt_error (buffer); + mutt_error ("%s", buffer); break; } @@ -302,16 +300,16 @@ void mutt_fetchPopMail (void) { err = 1; mutt_remove_trailing_ws (buffer); - mutt_error (buffer); + mutt_error ("%s", buffer); break; } } + + if ( msgs > 1) + mutt_message (_("%s [%d of %d messages read]"), msgbuf, i, msgs); + else + mutt_message (_("%s [%d message read]"), msgbuf, msgs); - if ( msgs > 1) - mutt_message (_("%s [%d of %d messages read]"), msgbuf, i, msgs); - else - mutt_message (_("%s [%d message read]"), msgbuf, msgs); - } if (msg) diff --git a/query.c b/query.c index ad497465..db8ce0fe 100644 --- a/query.c +++ b/query.c @@ -131,13 +131,12 @@ static QUERY *run_query (char *s, int quiet) if (mutt_wait_filter (thepid)) { dprint (1, (debugfile, "Error: %s\n", msg)); - if (!quiet) - mutt_error (msg); + if (!quiet) mutt_error ("%s", msg); } else { if (!quiet) - mutt_message (msg); + mutt_message ("%s", msg); } return first; diff --git a/remailer.c b/remailer.c index 65730166..c8f71766 100644 --- a/remailer.c +++ b/remailer.c @@ -595,11 +595,8 @@ void mix_make_chain (LIST **chainp, int *redraw) if (chain->cl && chain->ch[chain->cl - 1] && (type2_list[chain->ch[chain->cl-1]]->caps & MIX_CAP_MIDDLEMAN)) { - char buff[SHORT_STRING]; - - snprintf (buff, sizeof (buff), _("Error: %s can't be used as the final remailer of a chain."), + mutt_error ( _("Error: %s can't be used as the final remailer of a chain."), type2_list[chain->ch[chain->cl - 1]]->shortname); - mutt_error (buff); } else { @@ -628,12 +625,8 @@ void mix_make_chain (LIST **chainp, int *redraw) c_redraw = 1; } else - { - char buff[SHORT_STRING]; - snprintf (buff, sizeof (buff), _("Mixmaster chains are limited to %d elements."), + mutt_error ( _("Mixmaster chains are limited to %d elements."), MAXMIXES); - mutt_error (buff); - } break; }