]> granicus.if.org Git - sudo/commitdiff
Fixed a bug that caused an infinite loop when the password timeout was disabled.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 27 Feb 2000 03:11:23 +0000 (03:11 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 27 Feb 2000 03:11:23 +0000 (03:11 +0000)
tgetpass.c

index 586a6b927c419fe13cff63ad935172a68eb799f5..f2935fd87116d37cb17e636a6b46f39da8aa3fb3 100644 (file)
@@ -223,7 +223,7 @@ tgetline(fd, buf, bufsiz, timeout)
        free(readfds);
     } else {
        /* Keep reading until out of space, EOF, error, or newline */
-       while (--left && (n = read(fd, &c, 1)) == 1 && (c != '\n' || c != '\r'))
+       while (--left && (n = read(fd, &c, 1)) == 1 && c != '\n' && c != '\r')
            *cp++ = c;
     }
     *cp = '\0';