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 /lib | |
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 'lib')
-rw-r--r-- | lib/libcurses/tinfo/captoinfo.c | 4 | ||||
-rw-r--r-- | lib/libcurses/tinfo/make_keys.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libcurses/tinfo/captoinfo.c b/lib/libcurses/tinfo/captoinfo.c index 87e708c1780..291cecb0a44 100644 --- a/lib/libcurses/tinfo/captoinfo.c +++ b/lib/libcurses/tinfo/captoinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: captoinfo.c,v 1.13 2006/03/12 00:29:34 deraadt Exp $ */ +/* $OpenBSD: captoinfo.c,v 1.14 2006/10/10 21:38:16 cloder Exp $ */ /**************************************************************************** * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * @@ -819,7 +819,7 @@ main(int argc, char *argv[]) char buf[BUFSIZ]; ++curr_line; - if (fgets(buf, sizeof(buf), stdin) == 0) + if (fgets(buf, sizeof(buf), stdin) == NULL) break; buf[strlen(buf) - 1] = '\0'; _nc_set_source(buf); diff --git a/lib/libcurses/tinfo/make_keys.c b/lib/libcurses/tinfo/make_keys.c index d04a9a71608..0b6697d0319 100644 --- a/lib/libcurses/tinfo/make_keys.c +++ b/lib/libcurses/tinfo/make_keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: make_keys.c,v 1.7 2001/01/22 18:01:54 millert Exp $ */ +/* $OpenBSD: make_keys.c,v 1.8 2006/10/10 21:38:16 cloder Exp $ */ /**************************************************************************** * Copyright (c) 1998,2000 Free Software Foundation, Inc. * @@ -75,7 +75,7 @@ make_keys(FILE * ifp, FILE * ofp) char to[BUFSIZ]; int maxlen = 16; - while (fgets(buffer, sizeof(buffer), ifp) != 0) { + while (fgets(buffer, sizeof(buffer), ifp) != NULL) { if (*buffer == '#') continue; if (sscanf(buffer, "%s %s", to, from) == 2) { |