Replace mh_xmalloc() with mh_xcalloc()
[mmh] / uip / repl.c
index 71ae98e..fa1a7b4 100644 (file)
@@ -145,14 +145,14 @@ main(int argc, char **argv)
        FILE *in;
        int buildsw = 0;
 
-       filter = getcpy(etcpath(mhlreply));
-
        setlocale(LC_ALL, "");
        invo_name = mhbasename(argv[0]);
 
        /* read user profile/context */
        context_read();
 
+       filter = getcpy(etcpath(mhlreply));
+
        arguments = getarguments(invo_name, argc, argv, 1);
        argp = arguments;
 
@@ -420,7 +420,7 @@ replout(FILE *inb, char *drft, struct msgs *mp,
        *--savecomp = NULL;  /* point at zero'd end minus 1 */
 
        for (i = ncomps; i--; )
-               *nxtbuf++ = mh_xmalloc(SBUFSIZ);
+               *nxtbuf++ = mh_xcalloc(SBUFSIZ, sizeof(char));
 
        nxtbuf = compbuffers;  /* point at start */
        tmpbuf = *nxtbuf++;
@@ -543,7 +543,7 @@ finished:
                }
        }
        i = format_len + char_read + 256;
-       scanl = mh_xmalloc((size_t) i + 2);
+       scanl = mh_xcalloc((size_t) i + 2, sizeof(char));
        dat[0] = 0;
        dat[1] = 0;
        dat[2] = 0;
@@ -646,7 +646,7 @@ formataddr(char *orig, char *str)
 
        /* if we don't have a buffer yet, get one */
        if (bufsiz == 0) {
-               buf = mh_xmalloc(BUFINCR);
+               buf = mh_xcalloc(BUFINCR, sizeof(char));
                last_dst = buf;  /* XXX */
                bufsiz = BUFINCR - 6;  /* leave some slop */
                bufend = buf + bufsiz;