]> diplodocus.org Git - nmh/blobdiff - uip/ap.c
read_switch_multiword.c: Flip if-condition so return moves from else block.
[nmh] / uip / ap.c
index b158416ad891475e8679d592ce2a0c84a06dddcf..d08a635d38ef464ba63a6becd99519e45ccdad5e 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
@@ -12,6 +10,7 @@
 #include <h/fmt_scan.h>
 #include <h/mts.h>
 #include <h/utils.h>
+#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;
 }