changeset 5615:ce383c80a177

Merge with -stable
author Bryan O'Sullivan <bos@serpentine.com>
date Thu, 06 Dec 2007 09:55:56 -0800
parents 2e76e5a23c2b (current diff) 5133e9f61700 (diff)
children 88ca3e0fb6e5
files
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bdiff.c	Mon Dec 03 17:28:26 2007 -0600
+++ b/mercurial/bdiff.c	Thu Dec 06 09:55:56 2007 -0800
@@ -245,7 +245,7 @@
 
 	/* allocate and fill arrays */
 	t = equatelines(a, an, b, bn);
-	pos = (struct pos *)calloc(bn, sizeof(struct pos));
+	pos = (struct pos *)calloc((bn>0)?bn:1, sizeof(struct pos));
 	/* we can't have more matches than lines in the shorter file */
 	l.head = l.base = (struct hunk *)malloc(sizeof(struct hunk) *
 	                                        ((an<bn ? an:bn) + 1));