]> diplodocus.org Git - nmh/blobdiff - uip/rcvdist.c
Replace some ints that are only ever 0 or 1 with bool.
[nmh] / uip / rcvdist.c
index f30a573cde23c607cb7ad150a12cccc20ba060ca..e90674035f2201fa4c78ea484c5bb921d4d008de 100644 (file)
@@ -10,6 +10,7 @@
 #include <h/rcvmail.h>
 #include <h/tws.h>
 #include <h/mts.h>
 #include <h/rcvmail.h>
 #include <h/tws.h>
 #include <h/mts.h>
+#include "h/done.h"
 #include <h/utils.h>
 #include "sbr/m_mktemp.h"
 
 #include <h/utils.h>
 #include "sbr/m_mktemp.h"
 
@@ -47,9 +48,9 @@ main (int argc, char **argv)
     FILE *fp;
     char *tfile = NULL;
 
     FILE *fp;
     char *tfile = NULL;
 
-    if (nmh_init(argv[0], 2)) { return 1; }
+    if (nmh_init(argv[0], true, false)) { return 1; }
 
 
-    done=unlink_done;
+    set_done(unlink_done);
 
     /*
      * Configure this now, since any unknown switches to rcvdist get
 
     /*
      * Configure this now, since any unknown switches to rcvdist get
@@ -84,7 +85,7 @@ main (int argc, char **argv)
 
                case FORMSW: 
                    if (!(form = *argp++) || *form == '-')
 
                case FORMSW: 
                    if (!(form = *argp++) || *form == '-')
-                       adios (NULL, "missing argument to %s", argp[-2]);
+                       die("missing argument to %s", argp[-2]);
                    continue;
            }
        }
                    continue;
            }
        }
@@ -92,13 +93,13 @@ main (int argc, char **argv)
     }
 
     if (addrs == NULL)
     }
 
     if (addrs == NULL)
-       adios (NULL, "usage: %s [switches] [switches for postproc] address ...",
+       die("usage: %s [switches] [switches for postproc] address ...",
            invo_name);
 
     umask (~m_gmprot ());
 
     if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
            invo_name);
 
     umask (~m_gmprot ());
 
     if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
-       adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+       die("unable to create temporary file in %s", get_temp_dir());
     }
     strncpy (tmpfil, tfile, sizeof(tmpfil));
 
     }
     strncpy (tmpfil, tfile, sizeof(tmpfil));
 
@@ -106,7 +107,7 @@ main (int argc, char **argv)
     fseek (fp, 0L, SEEK_SET);
 
     if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
     fseek (fp, 0L, SEEK_SET);
 
     if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
-       adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+       die("unable to create temporary file in %s", get_temp_dir());
     }
     strncpy (drft, tfile, sizeof(tmpfil));
 
     }
     strncpy (drft, tfile, sizeof(tmpfil));
 
@@ -226,7 +227,7 @@ rcvdistout (FILE *inb, char *form, char *addrs)
                goto finished;
 
            default: 
                goto finished;
 
            default: 
-               adios (NULL, "m_getfld2() returned %d", state);
+               die("m_getfld2() returned %d", state);
        }
     }
 finished: ;
        }
     }
 finished: ;