X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Ffolder_realloc.c;h=e7c4bc442bb6955da611d1c99fe72b3d84f6d392;hp=f3130f144f9b03674c02e7fb62b690422dc52672;hb=389877bae1fe1a9f7259b8979f6a930744d90fab;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b diff --git a/sbr/folder_realloc.c b/sbr/folder_realloc.c index f3130f1..e7c4bc4 100644 --- a/sbr/folder_realloc.c +++ b/sbr/folder_realloc.c @@ -3,9 +3,14 @@ * 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 +#include /* * Reallocate some of the space in the folder @@ -42,10 +47,7 @@ folder_realloc (struct msgs *mp, int lo, int hi) * 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 @@ -54,10 +56,7 @@ folder_realloc (struct msgs *mp, int lo, int hi) 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) {