X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fflist.c;h=d2433a2013e349595afca09ad376127be64fa961;hp=68acabb11f3ca5d7f2eae0cc05cfe67062f68c1c;hb=10eff860a28b96582526eb739fd0a55441669938;hpb=d6742b1bb19c7eca8488402484a6e4f55543d789 diff --git a/uip/flist.c b/uip/flist.c index 68acabb..d2433a2 100644 --- a/uip/flist.c +++ b/uip/flist.c @@ -143,8 +143,7 @@ main(int argc, char **argv) /* allocate the initial space to record the folder names */ numfolders = 0; maxfolders = MAXFOLDERS; - foldersToDo = (char **) mh_xmalloc((size_t) - (maxfolders * sizeof(*foldersToDo))); + foldersToDo = (char **) mh_xcalloc((size_t) maxfolders, sizeof(*foldersToDo)); /* no sequences yet */ numsequences = 0; @@ -295,7 +294,7 @@ GetFolderOrder(void) AllocFolders(&orders, &nOrdersAlloced, nOrders + 1); o = &orders[nOrders++]; o->priority = priority++; - o->name = (char *) mh_xmalloc(p - s + 1); + o->name = (char *) mh_xcalloc(p - s + 1, sizeof(char)); strncpy(o->name, s, p - s); o->name[p - s] = 0; } else @@ -624,8 +623,7 @@ AllocFolders(struct Folder **f, int *nfa, int n) return; if (*f == NULL) { *nfa = 10; - *f = (struct Folder *) mh_xmalloc( - *nfa * (sizeof(struct Folder))); + *f = (struct Folder *) mh_xcalloc(*nfa, sizeof(struct Folder)); } else { *nfa *= 2; *f = (struct Folder *) mh_xrealloc(