Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/mpatch.c @ 3138:cc856c4d91ca
mpatch: Fix for malloc corner case on AIX
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 21 Sep 2006 16:16:39 -0500 |
parents | 345bac2bc4ec |
children | 95ffa36d1d2a 11dc22eb8e8d |
comparison
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; |