diff options
author | kevlo <kevlo@FreeBSD.org> | 2012-01-13 06:51:15 +0000 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2012-01-13 06:51:15 +0000 |
commit | 96dbfe4e2de39c163a56b1d941ba673c95154896 (patch) | |
tree | 2f39c41e193505df2d97cf331a8647c9f25c53c9 /usr.bin | |
parent | 6898680f64062d1debcda280c9b38d4e54905c66 (diff) | |
download | FreeBSD-src-96dbfe4e2de39c163a56b1d941ba673c95154896.zip FreeBSD-src-96dbfe4e2de39c163a56b1d941ba673c95154896.tar.gz |
fgets(3) returns a pointer, so compare against NULL, not integer 0.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mail/edit.c | 2 | ||||
-rw-r--r-- | usr.bin/tftp/main.c | 2 | ||||
-rw-r--r-- | usr.bin/unzip/unzip.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mail/edit.c b/usr.bin/mail/edit.c index d1ff37f..ad8aa53 100644 --- a/usr.bin/mail/edit.c +++ b/usr.bin/mail/edit.c @@ -89,7 +89,7 @@ edit1(int *msgvec, int type) char *p; printf("Edit message %d [ynq]? ", msgvec[i]); - if (fgets(buf, sizeof(buf), stdin) == 0) + if (fgets(buf, sizeof(buf), stdin) == NULL) break; for (p = buf; *p == ' ' || *p == '\t'; p++) ; diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c index 0092827..669299b 100644 --- a/usr.bin/tftp/main.c +++ b/usr.bin/tftp/main.c @@ -734,7 +734,7 @@ command(void) history(hist, &he, H_ENTER, bp); } else { line[0] = 0; - if (fgets(line, sizeof line , stdin) == 0) { + if (fgets(line, sizeof line , stdin) == NULL) { if (feof(stdin)) { exit(txrx_error); } else { diff --git a/usr.bin/unzip/unzip.c b/usr.bin/unzip/unzip.c index 1fa3564..accd653 100644 --- a/usr.bin/unzip/unzip.c +++ b/usr.bin/unzip/unzip.c @@ -422,7 +422,7 @@ handle_existing_file(char **path) fprintf(stderr, "replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", *path); - if (fgets(buf, sizeof(buf), stdin) == 0) { + if (fgets(buf, sizeof(buf), stdin) == NULL) { clearerr(stdin); printf("NULL\n(EOF or read error, " "treating as \"[N]one\"...)\n"); |