From ac153baba6893597d9bfc0e22469736fbc5e6821 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Sat, 28 Oct 2017 13:57:00 +0100 Subject: [PATCH] whatnow: Remove undocumented printf-formatting of -prompt string. whatnow(1)'s -prompt option would use the value as a printf(3) format string, supplying `invo_name' as the sole value to be formatted. This was undocumented, and upset gcc's checking of format strings. As no requests to keep the ability appeared on nmh-workers in reply to 2017-08-09's email, treat -prompt's value as a simple string. --- uip/whatnowsbr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 4cab2bab..9092f0e4 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -123,7 +123,7 @@ WhatNow (int argc, char **argv) int isdf = 0, nedit = 0, use = 0, atfile = 1; char *cp, *dfolder = NULL, *dmsg = NULL; char *ed = NULL, *drft = NULL, *msgnam = NULL; - char buf[BUFSIZ], prompt[BUFSIZ]; + char buf[BUFSIZ]; char **argp, **arguments; struct stat st; char cwd[PATH_MAX + 1]; /* current working directory */ @@ -224,12 +224,11 @@ WhatNow (int argc, char **argv) NULL, 1, atfile) < 0) done (1); - snprintf (prompt, sizeof(prompt), myprompt, invo_name); for (;;) { #ifdef READLINE_SUPPORT - if (!(argp = read_switch_multiword_via_readline (prompt, aleqs))) { + if (!(argp = read_switch_multiword_via_readline(myprompt, aleqs))) { #else /* ! READLINE_SUPPORT */ - if (!(argp = read_switch_multiword (prompt, aleqs))) { + if (!(argp = read_switch_multiword(myprompt, aleqs))) { #endif /* READLINE_SUPPORT */ (void) m_unlink (LINK); done (1); -- 2.56.0