Fix bug in buffer.c when multiple lines arrive at once.