X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Ffolder.c;h=3348ae56b90dc6b47e3299cece827ce496e30545;hp=2cc9bde689d0a51d44564b75bf910e5394f53970;hb=81a21a9a97d8633f6d6231e31fdb6e328d0d3ff2;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68 diff --git a/uip/folder.c b/uip/folder.c index 2cc9bde..3348ae5 100644 --- a/uip/folder.c +++ b/uip/folder.c @@ -12,6 +12,7 @@ */ #include +#include #include static struct swit switches[] = { @@ -66,8 +67,6 @@ static struct swit switches[] = { { NULL, 0 } }; -extern int errno; - static int fshort = 0; /* output only folder names */ static int fcreat = 0; /* should we ask to create new folders? */ static int fpack = 0; /* are we packing the folder? */ @@ -355,13 +354,11 @@ main (int argc, char **argv) /* Allocate initial space to record folder names */ maxfolders = NUMFOLDERS; - if ((folds = malloc (maxfolders * sizeof(char *))) == NULL) - adios (NULL, "unable to allocate storage for folder names"); + folds = mh_xmalloc (maxfolders * sizeof(char *)); /* Allocate initial space to record folder information */ maxFolderInfo = NUMFOLDERS; - if ((fi = malloc (maxFolderInfo * sizeof(*fi))) == NULL) - adios (NULL, "unable to allocate storage for folder info"); + fi = mh_xmalloc (maxFolderInfo * sizeof(*fi)); /* * Scan the folders @@ -818,10 +815,6 @@ readonly_folders (void) char atrcur[BUFSIZ]; register struct node *np; - /* sanity check - check that context has been read */ - if (defpath == NULL) - adios (NULL, "oops, context hasn't been read yet"); - snprintf (atrcur, sizeof(atrcur), "atr-%s-", current); atrlen = strlen (atrcur);