X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/e62400a894407812a6774c1a0eddde91142a42eb..89edf0508f6df4700d0e28cace04e44fec4ff735:/uip/ap.c?ds=inline diff --git a/uip/ap.c b/uip/ap.c index b158416a..1d1ee522 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 @@ -12,6 +10,7 @@ #include #include #include +#include "sbr/terminal.h" #define NADDRS 100 @@ -51,14 +50,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 + 1]; /* Includes terminating NULL. */ + 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)) { @@ -98,8 +96,7 @@ main (int argc, char **argv) } if (addrp == NADDRS) adios (NULL, "more than %d addresses", NADDRS); - else - addrs[addrp++] = cp; + addrs[addrp++] = cp; } addrs[addrp] = NULL; @@ -131,7 +128,7 @@ main (int argc, char **argv) status += process (addrs[addrp], width); fmt_free (fmt, 1); - done (status); + done(!!status); return 1; }