X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/9cf9f118998a7635485e13863d1bc16c1486bb05..f345b9b480296b4b6a8469d6221752893c5d1420:/uip/sortm.c diff --git a/uip/sortm.c b/uip/sortm.c index f6a66f16..0b8e1853 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -78,11 +78,7 @@ main (int argc, char **argv) struct smsg **dlist; int checksw = 0; - setlocale(LC_ALL, ""); - invo_name = r1bindex (argv[0], '/'); - - /* read user profile/context */ - context_read(); + if (nmh_init(argv[0], 1)) { return 1; } arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; @@ -257,7 +253,7 @@ main (int argc, char **argv) * the collection of messages with the same subj * given a message number. */ - il = (struct smsg ***) calloc (mp->hghsel+1, sizeof(*il)); + il = (struct smsg ***) mh_xcalloc (mp->hghsel+1, sizeof(*il)); if (! il) adios (NULL, "couldn't allocate msg list"); for (i = 0; i < nmsgs; i++) @@ -291,6 +287,7 @@ main (int argc, char **argv) } } *fp = 0; + free (il); free (slist); free (dlist); dlist = flist; @@ -321,7 +318,7 @@ read_hdrs (struct msgs *mp, char *datesw) twscopy (&tb, dlocaltimenow ()); smsgs = (struct smsg *) - calloc ((size_t) (mp->hghsel - mp->lowsel + 2), + mh_xcalloc ((size_t) (mp->hghsel - mp->lowsel + 2), sizeof(*smsgs)); if (smsgs == NULL) adios (NULL, "unable to allocate sort storage");