2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Fixed a bug that caused an infinite loop when the password timeout was disabled.

This commit is contained in:
Todd C. Miller
2000-02-27 03:11:23 +00:00
parent 09b23e7b41
commit de44c711bb

View 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';