From: Todd C. Miller Date: Thu, 3 Jun 1999 16:34:10 +0000 (+0000) Subject: Fix open(2) return value checking, was NULL for fopen, should be -1 for open X-Git-Tag: SUDO_1_6_0~272 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1eab167a3064e3d302c27edcf311163b953d81ba;p=sudo Fix open(2) return value checking, was NULL for fopen, should be -1 for open --- diff --git a/tgetpass.c b/tgetpass.c index 4f4f1b994..68d713891 100644 --- a/tgetpass.c +++ b/tgetpass.c @@ -128,7 +128,7 @@ tgetpass(prompt, timeout) * open /dev/tty for reading/writing if possible or use * stdin and stderr instead. */ - if ((input = output = open(_PATH_TTY, O_RDWR)) == NULL) { + if ((input = output = open(_PATH_TTY, O_RDWR)) == -1) { input = STDIN_FILENO; output = STDERR_FILENO; }