X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/9fce8ab3a8a0134261cb796add60a1248e8ae38f..e6c91771:/uip/ap.c?ds=sidebyside diff --git a/uip/ap.c b/uip/ap.c index bfec3429..930d0ad4 100644 --- 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;