X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhlist.c;h=7056db5f7618f71c7cfd22c8840c1a8996d914e0;hp=9022ecfa170e46347b71fccaf7d9ab6decd5ac28;hb=6e9577f324bef90765a5edc02044eb111ec48072;hpb=72795bfcbe9f7fee8927b1a4942c0230b0f857a8 diff --git a/uip/mhlist.c b/uip/mhlist.c index 9022ecf..7056db5 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -40,6 +40,7 @@ static struct swit switches[] = { { NULL, 0 } }; +char *version=VERSION; /* mhparse.c */ extern char *tmp; /* directory to place temp files */ @@ -151,7 +152,7 @@ main(int argc, char **argv) if (!(cp = *argp++) || (*cp == '-' && cp[1])) adios(EX_USAGE, NULL, "missing argument to %s", argp[-2]); - file = *cp == '-' ? cp : getcpy(expanddir(cp)); + file = *cp == '-' ? cp : mh_xstrdup(expanddir(cp)); continue; case VERBSW: @@ -169,7 +170,7 @@ main(int argc, char **argv) if (folder) adios(EX_USAGE, NULL, "only one folder at a time!"); else - folder = getcpy(expandfol(cp)); + folder = mh_xstrdup(expandfol(cp)); } else app_msgarg(&msgs, cp); } @@ -188,7 +189,7 @@ main(int argc, char **argv) if ((cp = context_find(nmhstorage)) && *cp) tmp = concat(cp, "/", invo_name, NULL); else - tmp = getcpy(toabsdir(invo_name)); + tmp = mh_xstrdup(toabsdir(invo_name)); if (file && msgs.size) adios(EX_USAGE, NULL, "cannot specify msg and file at same time!"); @@ -197,8 +198,7 @@ main(int argc, char **argv) ** check if message is coming from file */ if (file) { - if (!(cts = (CT *) mh_xcalloc((size_t) 2, sizeof(*cts)))) - adios(EX_OSERR, NULL, "out of memory"); + cts = mh_xcalloc(2, sizeof(*cts)); ctp = cts; if ((ct = parse_mime(file))) @@ -232,9 +232,7 @@ main(int argc, char **argv) } seq_setprev(mp); /* set the previous-sequence */ - if (!(cts = (CT *) mh_xcalloc((size_t) (mp->numsel + 1), - sizeof(*cts)))) - adios(EX_OSERR, NULL, "out of memory"); + cts = mh_xcalloc(mp->numsel + 1, sizeof(*cts)); ctp = cts; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { @@ -279,8 +277,7 @@ main(int argc, char **argv) for (ctp = cts; *ctp; ctp++) free_content(*ctp); - free((char *) cts); - cts = NULL; + mh_free0(&cts); /* If reading from a folder, do some updating */ if (mp) {