mercurial/mpatch.c
changeset 3138 cc856c4d91ca
parent 2858 345bac2bc4ec
child 4073 95ffa36d1d2a
child 4375 11dc22eb8e8d
equal deleted inserted replaced
3137:2c472ab42b08 3138:cc856c4d91ca
    60 
    60 
    61 static struct flist *lalloc(int size)
    61 static struct flist *lalloc(int size)
    62 {
    62 {
    63 	struct flist *a = NULL;
    63 	struct flist *a = NULL;
    64 
    64 
       
    65 	if (size < 1)
       
    66 		size = 1;
       
    67 
    65 	a = (struct flist *)malloc(sizeof(struct flist));
    68 	a = (struct flist *)malloc(sizeof(struct flist));
    66 	if (a) {
    69 	if (a) {
    67 		a->base = (struct frag *)malloc(sizeof(struct frag) * size);
    70 		a->base = (struct frag *)malloc(sizeof(struct frag) * size);
    68 		if (a->base) {
    71 		if (a->base) {
    69 			a->head = a->tail = a->base;
    72 			a->head = a->tail = a->base;