r271256 fixed one segfault condition but introduced another due to the
wrong operator being used in the tty check.

Reported by:	avg@
MFH:		3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@271617 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f