From bf3ef98bae3fa7925611b291e7c2bb028203070a Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 14 Aug 1995 03:34:36 +0000 Subject: [PATCH] fixed a core dump due to incorrect if construct --- logging.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/logging.c b/logging.c index fa18c6d35..bc61f4d2a 100644 --- a/logging.c +++ b/logging.c @@ -136,9 +136,8 @@ void log_error(code) * Get our ttyname or set to "none" */ tty = (char *) ttyname(0); - if (tty) - if ((p = strrchr(tty, '/'))) - tty = p + 1; + if (tty && (p = strrchr(tty, '/'))) + tty = p + 1; else tty = "none"; -- 2.50.1