From ca817738feb3dbccb047a79a8bba9d9ef8d35bef Mon Sep 17 00:00:00 2001 From: Chad Loder Date: Tue, 10 Oct 2006 21:38:17 +0000 Subject: fgets(3) returns NULL on error, not 0. No functional change, but it makes the code easier to read. OK deraadt --- gnu/usr.bin/groff/psbb/psbb.c | 4 ++-- gnu/usr.bin/lynx/src/LYStrings.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'gnu') diff --git a/gnu/usr.bin/groff/psbb/psbb.c b/gnu/usr.bin/groff/psbb/psbb.c index 3d1f343ed55..43de191d34f 100644 --- a/gnu/usr.bin/groff/psbb/psbb.c +++ b/gnu/usr.bin/groff/psbb/psbb.c @@ -80,7 +80,7 @@ struct bounding_box *bb; return "%s is empty"; if (strncmp("%!PS-Adobe-", buf, 11) != 0) return "%s is not conforming"; - while (fgets(buf, sizeof(buf), fp) != 0) { + while (fgets(buf, sizeof(buf), fp) != NULL) { if (buf[0] != '%' || buf[1] != '%' || strncmp(buf + 2, "EndComments", 11) == 0) break; @@ -108,7 +108,7 @@ struct bounding_box *bb; if (fseek(fp, 0L, 0) == -1) break; } - while (fgets(buf, sizeof(buf), fp) != 0) { + while (fgets(buf, sizeof(buf), fp) != NULL) { if (buf[0] == '%' && buf[1] == '%') { if (!had_trailer) { if (strncmp(buf + 2, "Trailer", 7) == 0) diff --git a/gnu/usr.bin/lynx/src/LYStrings.c b/gnu/usr.bin/lynx/src/LYStrings.c index b2c87fdfa57..a8f466cead4 100644 --- a/gnu/usr.bin/lynx/src/LYStrings.c +++ b/gnu/usr.bin/lynx/src/LYStrings.c @@ -5612,7 +5612,7 @@ PUBLIC char *LYSafeGets ARGS2( if (result != 0) *result = 0; - while (fgets(buffer, sizeof(buffer), fp) != 0) { + while (fgets(buffer, sizeof(buffer), fp) != NULL) { if (*buffer) result = StrAllocCat(result, buffer); if (strchr(buffer, '\n') != 0) -- cgit v1.2.3