]> diplodocus.org Git - nmh/blobdiff - uip/slocal.c
ap: Fix write past end of addrs[] array.
[nmh] / uip / slocal.c
index 772c4e2bb0fc55dd88abdf60021c4cf0dc5f0b16..41eda311dbe89eac4d5d418ac262420bf76fbccc 100644 (file)
@@ -1250,11 +1250,10 @@ you_lose:
      * and massage the headers.  Save
      * a copy of the "From " line for later.
      */
-    i = LEN("From ");
     while (fgets (buffer, sizeof(buffer), qfp)) {
        if (first) {
            first = 0;
-           if (!strncmp (buffer, "From ", i)) {
+           if (HasPrefix(buffer, "From ")) {
                /* get copy of envelope information ("From " line) */
                envelope = mh_xstrdup(buffer);
 
@@ -1338,7 +1337,7 @@ verbose_printf (char *fmt, ...)
     va_list ap;
 
     va_start(ap, fmt);
-    vfprintf (stdout, fmt, ap);
+    vprintf(fmt, ap);
     va_end(ap);
 
     fflush (stdout);   /* now flush output */
@@ -1358,22 +1357,22 @@ adorn (char *what, char *fmt, ...)
     char *s;
 
     eindex = errno;    /* save the errno */
-    fprintf (stdout, ", ");
+    printf(", ");
 
     va_start(ap, fmt);
-    vfprintf (stdout, fmt, ap);
+    vprintf(fmt, ap);
     va_end(ap);
 
     if (what) {
        if (*what)
-           fprintf (stdout, " %s: ", what);
+           printf(" %s: ", what);
        if ((s = strerror (eindex)))
-           fprintf (stdout, "%s", s);
+           fputs(s, stdout);
        else
-           fprintf (stdout, "Error %d", eindex);
+           printf("Error %d", eindex);
     }
 
-    fputc ('\n', stdout);
+    putchar('\n');
     fflush (stdout);
 }