]> granicus.if.org Git - sudo/commitdiff
fixed a core dump due to incorrect if construct
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 14 Aug 1995 03:34:36 +0000 (03:34 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 14 Aug 1995 03:34:36 +0000 (03:34 +0000)
logging.c

index fa18c6d35d28c65cdc7102cafa7e4da8ce3ce5a5..bc61f4d2a810d9c478d79ec9000bbc376985a6c0 100644 (file)
--- 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";