* folder_realloc.c -- realloc a folder/msgs structure
*
* $Id$
+ *
+ * This code is Copyright (c) 2002, by the authors of nmh. See the
+ * COPYRIGHT file in the root directory of the nmh distribution for
+ * complete copyright information.
*/
#include <h/mh.h>
+#include <h/utils.h>
/*
* Reallocate some of the space in the folder
* status array. So we don't have to move anything and can
* just realloc the message status array.
*/
- if (!(mp->msgstats = realloc (mp->msgstats, MSGSTATSIZE(mp, lo, hi)))) {
- advise (NULL, "unable to reallocate message storage");
- return NULL;
- }
+ mp->msgstats = mh_xrealloc (mp->msgstats, MSGSTATSIZE(mp, lo, hi));
} else {
/*
* We are changing the offset of the message status
seqset_t *tmpstats;
/* first allocate the new message status space */
- if (!(tmpstats = malloc (MSGSTATSIZE(mp, lo, hi)))) {
- advise (NULL, "unable to reallocate message storage");
- return NULL;
- }
+ tmpstats = mh_xmalloc (MSGSTATSIZE(mp, lo, hi));
/* then copy messages status array with shift */
if (mp->nummsg > 0) {