diff options
author | Chad Loder <cloder@cvs.openbsd.org> | 2006-10-10 21:38:17 +0000 |
---|---|---|
committer | Chad Loder <cloder@cvs.openbsd.org> | 2006-10-10 21:38:17 +0000 |
commit | ca817738feb3dbccb047a79a8bba9d9ef8d35bef (patch) | |
tree | 1b3c3d53c613c58ec3dd701858f5ea0679e7260a /gnu | |
parent | 5322f980d2221f7cb9600d5bd4b0e15ab30164bd (diff) |
fgets(3) returns NULL on error, not 0. No functional change, but it makes
the code easier to read.
OK deraadt
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/groff/psbb/psbb.c | 4 | ||||
-rw-r--r-- | gnu/usr.bin/lynx/src/LYStrings.c | 2 |
2 files changed, 3 insertions, 3 deletions
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) |