From: David Levine Date: Sun, 16 Jul 2017 21:25:51 +0000 (-0400) Subject: Replaced snprintf() to convert an int with m_name(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/d71151030555757c05fc69a63e370873e482bfb3?ds=sidebyside;hp=7eecb2dcc4a30573ee644491a04e18d1acd7ec81 Replaced snprintf() to convert an int with m_name(). At Ralph's suggestion. The goal was to get rid of a warning from gcc -Wformat-truncation, but the code ends up being cleaner as well. --- diff --git a/uip/forw.c b/uip/forw.c index 77b2d0d9..331be16b 100644 --- a/uip/forw.c +++ b/uip/forw.c @@ -111,7 +111,7 @@ main (int argc, char **argv) char *dmsg = NULL, *digest = NULL, *ed = NULL; char *file = NULL, *filter = NULL, *folder = NULL, *fwdmsg = NULL; char *from = NULL, *to = NULL, *cc = NULL, *subject = NULL, *fcc = NULL; - char *form = NULL, buf[BUFSIZ], value[10]; + char *form = NULL, buf[BUFSIZ]; char **argp, **arguments; struct stat st; struct msgs_array msgs = { 0, 0, NULL }; @@ -454,11 +454,9 @@ try_it_again: if (digest) { snprintf (buf, sizeof(buf), IFORMAT, digest); - snprintf (value, sizeof(value), "%d", issue); - context_replace (buf, mh_xstrdup(value)); + context_replace (buf, mh_xstrdup(m_name(issue))); snprintf (buf, sizeof(buf), VFORMAT, digest); - snprintf (value, sizeof(value), "%d", volume); - context_replace (buf, mh_xstrdup(value)); + context_replace (buf, mh_xstrdup(m_name(volume))); } context_replace (pfolder, folder); /* update current folder */