Add check for lines larger than the buffer length