projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed make_bcc_file () to use contents of From: in draft, if draft_from masquerade...
[mmh]
/
uip
/
folder.c
diff --git
a/uip/folder.c
b/uip/folder.c
index
7706f90
..
d6cb5b5
100644
(file)
--- a/
uip/folder.c
+++ b/
uip/folder.c
@@
-12,6
+12,7
@@
*/
#include <h/mh.h>
*/
#include <h/mh.h>
+#include <h/utils.h>
#include <errno.h>
static struct swit switches[] = {
#include <errno.h>
static struct swit switches[] = {
@@
-66,8
+67,6
@@
static struct swit switches[] = {
{ NULL, 0 }
};
{ 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? */
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;
/* 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;
/* 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
/*
* Scan the folders
@@
-472,8
+469,7
@@
get_folder_info (char *fold, char *msg)
*/
if (total_folders >= maxFolderInfo) {
maxFolderInfo += NUMFOLDERS;
*/
if (total_folders >= maxFolderInfo) {
maxFolderInfo += NUMFOLDERS;
- if ((fi = realloc (fi, maxFolderInfo * sizeof(*fi))) == NULL)
- adios (NULL, "unable to re-allocate storage for folder info");
+ fi = mh_xrealloc (fi, maxFolderInfo * sizeof(*fi));
}
fi[i].name = fold;
}
fi[i].name = fold;
@@
-777,8
+773,7
@@
addfold (char *fold)
/* if necessary, reallocate the space for folder names */
if (foldp >= maxfolders) {
maxfolders += NUMFOLDERS;
/* if necessary, reallocate the space for folder names */
if (foldp >= maxfolders) {
maxfolders += NUMFOLDERS;
- if ((folds = realloc (folds, maxfolders * sizeof(char *))) == NULL)
- adios (NULL, "unable to re-allocate storage for folder names");
+ folds = mh_xrealloc (folds, maxfolders * sizeof(char *));
}
cp = getcpy (fold);
}
cp = getcpy (fold);