]> diplodocus.org Git - nmh/blobdiff - uip/ap.c
Remove support for ./.foo.map index for ./foo mailbox.
[nmh] / uip / ap.c
index bfec342923a7d033fe57901b82d6cc9e8957f3a4..930d0ad4c70e2b7bfea08fe83daec08d2e65805d 100644 (file)
--- a/uip/ap.c
+++ b/uip/ap.c
@@ -1,6 +1,4 @@
-
-/*
- * ap.c -- parse addresses 822-style
+/* ap.c -- parse addresses 822-style
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -51,14 +49,13 @@ main (int argc, char **argv)
     int width = -1, status = 0;
     char *cp, *form = NULL, *format = NULL, *nfs;
     char buf[BUFSIZ], **argp;
-    char **arguments, *addrs[NADDRS];
+    char *addrs[NADDRS + 1]; /* Includes terminating NULL. */
 
     if (nmh_init(argv[0], 2)) { return 1; }
 
     mts_init ();
-    arguments = getarguments (invo_name, argc, argv, 1);
-    argp = arguments;
 
+    argp = getarguments (invo_name, argc, argv, 1);
     while ((cp = *argp++)) {
        if (*cp == '-') {
            switch (smatch (++cp, switches)) {
@@ -96,7 +93,7 @@ main (int argc, char **argv)
                    continue;
            }
        }
-       if (addrp > NADDRS)
+       if (addrp == NADDRS)
            adios (NULL, "more than %d addresses", NADDRS);
        else
            addrs[addrp++] = cp;
@@ -192,7 +189,7 @@ process (char *arg, int length)
         mh_xfree(p->pq_text);
         mh_xfree(p->pq_error);
        q = p->pq_next;
-       free ((char *) p);
+       free(p);
     }
 
     return status;