Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/lib/libc/gen/getcap.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -p -r1.43 -r1.44 --- src/lib/libc/gen/getcap.c 2006/03/19 02:12:09 1.43 +++ src/lib/libc/gen/getcap.c 2006/03/19 02:25:12 1.44 @@ -1,4 +1,4 @@ -/* $NetBSD: getcap.c,v 1.43 2006/03/19 02:12:09 christos Exp $ */ +/* $NetBSD: getcap.c,v 1.44 2006/03/19 02:25:12 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)getcap.c 8.3 (Berkeley) 3/25/94"; #else -__RCSID("$NetBSD: getcap.c,v 1.43 2006/03/19 02:12:09 christos Exp $"); +__RCSID("$NetBSD: getcap.c,v 1.44 2006/03/19 02:25:12 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -785,7 +785,9 @@ cgetnext(char **bp, const char * const * line = toprec; } else { line = fgetln(pfp, &len); - if (line == NULL && pfp) { + if (line == NULL) { + if (pfp == NULL) + return -1; if (ferror(pfp)) { (void)cgetclose(); return (-1);