]> diplodocus.org Git - nmh/commitdiff
Replaced snprintf() to convert an int with m_name().
authorDavid Levine <levinedl@acm.org>
Sun, 16 Jul 2017 21:25:51 +0000 (17:25 -0400)
committerDavid Levine <levinedl@acm.org>
Sun, 16 Jul 2017 21:25:51 +0000 (17:25 -0400)
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.

uip/forw.c

index 77b2d0d9fd57099a57c220d1eefff2553fbdcdce..331be16bb9b2e0ac5324057e54964d142876305e 100644 (file)
@@ -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   */