projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* patch #3966: Create a mh_xmalloc function to prevent mistakes when
[mmh]
/
uip
/
folder.c
diff --git
a/uip/folder.c
b/uip/folder.c
index
2cc9bde
..
3348ae5
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
@@
-818,10
+815,6
@@
readonly_folders (void)
char atrcur[BUFSIZ];
register struct node *np;
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);
snprintf (atrcur, sizeof(atrcur), "atr-%s-", current);
atrlen = strlen (atrcur);