projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[mmh]
/
uip
/
folder.c
diff --git
a/uip/folder.c
b/uip/folder.c
index
e4779dc
..
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[] = {
@@
-353,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
@@
-470,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;
@@
-775,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);