fixed a core dump due to incorrect if construct

This commit is contained in:
Todd C. Miller
1995-08-14 03:34:36 +00:00
parent f1bd62ffb7
commit bf3ef98bae

View File

@@ -136,8 +136,7 @@ void log_error(code)
* Get our ttyname or set to "none" * Get our ttyname or set to "none"
*/ */
tty = (char *) ttyname(0); tty = (char *) ttyname(0);
if (tty) if (tty && (p = strrchr(tty, '/')))
if ((p = strrchr(tty, '/')))
tty = p + 1; tty = p + 1;
else else
tty = "none"; tty = "none";