X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fflist.c;h=d2433a2013e349595afca09ad376127be64fa961;hb=10eff860a28b96582526eb739fd0a55441669938;hp=091def783764e05ba5ec6ff40ca6ffa912a1fc9e;hpb=cf1205b5cbea2f0cd6ea710ec16c637df85b647c;p=mmh diff --git a/uip/flist.c b/uip/flist.c index 091def7..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( @@ -677,7 +675,7 @@ do_readonly_folders(void) { int atrlen; char atrcur[BUFSIZ]; - register struct node *np; + struct node *np; snprintf(atrcur, sizeof(atrcur), "atr-%s-", seq_cur); atrlen = strlen(atrcur);