X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fsortm.c;h=06ec0cac5a9c5e2149ec74d68a65d757005de954;hp=ae4038db6c2b3d68211fef3e21b92a7d29766ee1;hb=10eff860a28b96582526eb739fd0a55441669938;hpb=72795bfcbe9f7fee8927b1a4942c0230b0f857a8 diff --git a/uip/sortm.c b/uip/sortm.c index ae4038d..06ec0ca 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -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]; @@ -297,8 +295,6 @@ read_hdrs(struct msgs *mp, char *datesw) smsgs = (struct smsg *) mh_xcalloc((size_t) (mp->hghsel - mp->lowsel + 2), sizeof(*smsgs)); - if (smsgs == NULL) - adios(EX_OSERR, NULL, "unable to allocate sort storage"); s = smsgs; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { @@ -336,7 +332,6 @@ get_fields(char *datesw, int msg, struct smsg *smsg) for (compnum = 1, state = FLD;;) { switch (state = m_getfld(state, nam, buf, sizeof(buf), in)) { case FLD: - case FLDEOF: case FLDPLUS: compnum++; if (!mh_strcasecmp(nam, datesw)) { @@ -366,7 +361,6 @@ get_fields(char *datesw, int msg, struct smsg *smsg) continue; case BODY: - case BODYEOF: case FILEEOF: break;