--- util/texindex.c +++ util/texindex.c 2006-11-10 14:05:27.000000000 +0100 @@ -837,7 +837,7 @@ readline (struct linebuffer *linebuffer, { buffer = (char *) xrealloc (buffer, linebuffer->size *= 2); p += buffer - linebuffer->buffer; - end += buffer - linebuffer->buffer; + end = buffer + linebuffer->size; linebuffer->buffer = buffer; } if (c < 0 || c == '\n')