# HG changeset patch # User Bryan O'Sullivan # Date 1196963756 28800 # Node ID ce383c80a177787b9fdb2375f44e0c9125d4381f # Parent 2e76e5a23c2baa858314115d443826d8c7ea11a9# Parent 5133e9f61700b9f802018b36ba53c923ba7ad6ad Merge with -stable diff -r 2e76e5a23c2b -r ce383c80a177 mercurial/bdiff.c --- 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