fixed boundary condition when line terminator was not found