[PATCH openEuler-5.10 076/113] tty: n_tty: do not look ahead for EOL character past the end of the buffer