Replace mh_xmalloc() with mh_xcalloc()
[mmh] / uip / sortm.c
index 5d15ed6..06ec0ca 100644 (file)
@@ -224,8 +224,7 @@ main(int argc, char **argv)
                struct smsg **slist, **flist;
                struct smsg ***il, **fp, **dp;
 
-               slist = (struct smsg **)
-                               mh_xmalloc((nmsgs+1) * sizeof(*slist));
+               slist = (struct smsg **) mh_xcalloc(nmsgs+1, sizeof(*slist));
                memcpy((char *)slist, (char *)dlist, (nmsgs+1)*sizeof(*slist));
                qsort((char *)slist, nmsgs, sizeof(*slist),
                                (qsort_comp) subsort);
@@ -244,8 +243,7 @@ main(int argc, char **argv)
                ** make up the final list, chronological but with
                ** all the same subjects grouped together.
                */
-               flist = (struct smsg **)
-                               mh_xmalloc((nmsgs+1) * sizeof(*flist));
+               flist = (struct smsg **) mh_xcalloc(nmsgs+1, sizeof(*flist));
                fp = flist;
                for (dp = dlist; *dp;) {
                        struct smsg **s = il[(*dp++)->s_msg];