--- src/lib/libc/gen/getcap.c 2005/11/13 00:07:42 1.6 +++ src/lib/libc/gen/getcap.c 2005/11/19 22:32:53 1.7 @@ -196,6 +196,9 @@ getent(char **cap, u_int *len, char **db int tc_not_resolved; char pbuf[_POSIX_PATH_MAX]; + rp = NULL; + myfd = 0; + /* * Return with ``loop detected'' error if we've recursed more than * MAX_RECURSION times. @@ -641,6 +644,8 @@ cgetnext(char **bp, char **db_array) char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE]; u_int dummy; + savederrno = 0; + if (dbp == NULL) dbp = db_array;