mercurial/bdiff.c
changeset 5571 f84bb2e1cc3a
parent 5452 82b4ff3abbcd
child 5620 652f57de3ccf
equal deleted inserted replaced
5570:78a6b985882f 5571:f84bb2e1cc3a
   243 	struct pos *pos;
   243 	struct pos *pos;
   244 	int t;
   244 	int t;
   245 
   245 
   246 	/* allocate and fill arrays */
   246 	/* allocate and fill arrays */
   247 	t = equatelines(a, an, b, bn);
   247 	t = equatelines(a, an, b, bn);
   248 	pos = (struct pos *)calloc(bn, sizeof(struct pos));
   248 	pos = (struct pos *)calloc(bn ? bn : 1, sizeof(struct pos));
   249 	/* we can't have more matches than lines in the shorter file */
   249 	/* we can't have more matches than lines in the shorter file */
   250 	l.head = l.base = (struct hunk *)malloc(sizeof(struct hunk) *
   250 	l.head = l.base = (struct hunk *)malloc(sizeof(struct hunk) *
   251 	                                        ((an<bn ? an:bn) + 1));
   251 	                                        ((an<bn ? an:bn) + 1));
   252 
   252 
   253 	if (pos && l.base && t) {
   253 	if (pos && l.base && t) {