]> diplodocus.org Git - nmh/blobdiff - uip/ali.c
Don't have `static' of a function definition on its own line.
[nmh] / uip / ali.c
index 1c75644bf088402a33111bc1a810a62b35627b91..bcf8c79e4ba7cf24c476033fdfe8e40337471312 100644 (file)
--- a/uip/ali.c
+++ b/uip/ali.c
@@ -9,6 +9,7 @@
 #include <h/addrsbr.h>
 #include <h/aliasbr.h>
 #include <h/mts.h>
+#include "h/done.h"
 #include <h/utils.h>
 
 #define ALI_SWITCHES \
@@ -51,7 +52,7 @@ main (int argc, char **argv)
     char **vec = mh_xmalloc (argc * sizeof (char *)), **arguments;
     struct aka *ak;
 
-    if (nmh_init(argv[0], 1)) { return 1; }
+    if (nmh_init(argv[0], true, true)) { return 1; }
 
     mts_init ();
     arguments = getarguments (invo_name, argc, argv, 1);
@@ -65,7 +66,7 @@ main (int argc, char **argv)
                    ambigsw (cp, switches);
                    done (1);
                case UNKWNSW: 
-                   adios (NULL, "-%s unknown", cp);
+                   die("-%s unknown", cp);
 
                case HELPSW: 
                    snprintf (buf, sizeof(buf), "%s [switches] aliases ...",
@@ -78,9 +79,9 @@ main (int argc, char **argv)
 
                case ALIASW: 
                    if (!(cp = *argp++) || *cp == '-')
-                       adios (NULL, "missing argument to %s", argp[-2]);
+                       die("missing argument to %s", argp[-2]);
                    if ((i = alias (cp)) != AK_OK)
-                       adios (NULL, "aliasing error in %s - %s", cp, akerror (i));
+                       die("aliasing error in %s - %s", cp, akerror (i));
                    continue;
                case NALIASW: 
                    noalias = true;
@@ -107,7 +108,7 @@ main (int argc, char **argv)
        } else {
            /* Should never happen, but try to protect against code changes
               that could allow it. */
-           adios (NULL, "too many arguments");
+           die("too many arguments");
        }
     }
 
@@ -118,8 +119,8 @@ main (int argc, char **argv)
 
            for (ap = brkstring(dp = mh_xstrdup(cp), " ", "\n"); ap && *ap; ap++)
                if ((i = alias (*ap)) != AK_OK)
-                   adios (NULL, "aliasing error in %s - %s", *ap, akerror (i));
-            mh_xfree(dp);
+                   die("aliasing error in %s - %s", *ap, akerror (i));
+            free(dp);
        }
        alias (AliasFile);
     }
@@ -129,7 +130,7 @@ main (int argc, char **argv)
      */
     if (inverted) {
        if (vecp == 0)
-           adios (NULL, "usage: %s -user addresses ...  (you forgot the addresses)",
+           die("usage: %s -user addresses ...  (you forgot the addresses)",
                   invo_name);
 
        for (i = 0; i < vecp; i++)
@@ -176,10 +177,10 @@ print_aka (char *p, bool list, int margin)
                        printf ("\n%*s", margin, "");
                    else {
                        if (pos >= 68) {
-                           printf (",\n ");
+                           fputs(",\n ", stdout);
                            pos = 2;
                        } else {
-                           printf (", ");
+                           fputs(", ", stdout);
                            pos += 2;
                        }
                    }
@@ -206,9 +207,9 @@ print_usr (char *s, bool list)
     struct mailname *mp, *np;
 
     if ((pp = getname (s)) == NULL)
-       adios (NULL, "no address in \"%s\"", s);
+       die("no address in \"%s\"", s);
     if ((mp = getm (pp, NULL, 0, NULL, 0)) == NULL)
-       adios (NULL, "bad address \"%s\"", s);
+       die("bad address \"%s\"", s);
     while (getname (""))
        continue;
 
@@ -236,5 +237,5 @@ print_usr (char *s, bool list)
 
     print_aka (vp ? vp : s, list, 0);
 
-    mh_xfree(vp);
+    free(vp);
 }