From: Todd C. Miller Date: Mon, 14 Aug 1995 03:34:36 +0000 (+0000) Subject: fixed a core dump due to incorrect if construct X-Git-Tag: SUDO_1_4_0~233 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf3ef98bae3fa7925611b291e7c2bb028203070a;p=sudo fixed a core dump due to incorrect if construct --- 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";