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 rcsdiff: /ftp/cvs/cvsroot/src/lib/libc/gen/getcap.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.10 retrieving revision 1.14 diff -u -p -r1.10 -r1.14 --- src/lib/libc/gen/getcap.c 1995/08/24 05:26:35 1.10 +++ src/lib/libc/gen/getcap.c 1997/07/21 14:07:03 1.14 @@ -1,4 +1,4 @@ -/* $NetBSD: getcap.c,v 1.10 1995/08/24 05:26:35 mycroft Exp $ */ +/* $NetBSD: getcap.c,v 1.14 1997/07/21 14:07:03 jtc Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -36,16 +36,17 @@ * SUCH DAMAGE. */ +#include #if defined(LIBC_SCCS) && !defined(lint) #if 0 static char sccsid[] = "@(#)getcap.c 8.3 (Berkeley) 3/25/94"; #else -static char rcsid[] = "$NetBSD: getcap.c,v 1.10 1995/08/24 05:26:35 mycroft Exp $"; +__RCSID("$NetBSD: getcap.c,v 1.14 1997/07/21 14:07:03 jtc Exp $"); #endif #endif /* LIBC_SCCS and not lint */ +#include "namespace.h" #include - #include #include #include @@ -56,6 +57,19 @@ static char rcsid[] = "$NetBSD: getcap.c #include #include +#ifdef __weak_alias +__weak_alias(cgetcap,_cgetcap); +__weak_alias(cgetclose,_cgetclose); +__weak_alias(cgetent,_cgetent); +__weak_alias(cgetfirst,_cgetfirst); +__weak_alias(cgetmatch,_cgetmatch); +__weak_alias(cgetnext,_cgetnext); +__weak_alias(cgetnum,_cgetnum); +__weak_alias(cgetset,_cgetset); +__weak_alias(cgetstr,_cgetstr); +__weak_alias(cgetustr,_cgetustr); +#endif + #define BFRAG 1024 #define BSIZE 1024 #define ESC ('[' & 037) /* ASCII ESC */ @@ -96,7 +110,7 @@ cgetset(ent) return (-1); } gottoprec = 0; - (void)strcpy(toprec, ent); + (void)strcpy(toprec, ent); /* XXX: strcpy is safe */ return (0); } @@ -198,9 +212,8 @@ getent(cap, len, db_array, fd, name, dep int fd, depth; { DB *capdbp; - DBT key, data; - register char *r_end, *rp, **db_p; - int myfd, eof, foundit, retval, clen; + register char *r_end, *rp = NULL, **db_p; /* pacify gcc */ + int myfd = 0, eof, foundit, retval, clen; char *record, *cbuf; int tc_not_resolved; char pbuf[_POSIX_PATH_MAX]; @@ -220,8 +233,7 @@ getent(cap, len, db_array, fd, name, dep errno = ENOMEM; return (-2); } - (void)strcpy(record, toprec); - myfd = 0; + (void)strcpy(record, toprec); /* XXX: strcpy is safe */ db_p = db_array; rp = record + topreclen + 1; r_end = rp + BFRAG; @@ -249,7 +261,6 @@ getent(cap, len, db_array, fd, name, dep if (fd >= 0) { (void)lseek(fd, (off_t)0, L_SET); - myfd = 0; } else { (void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p); if ((capdbp = dbopen(pbuf, O_RDONLY, 0, DB_HASH, 0)) @@ -545,8 +556,6 @@ cdbget(capdbp, bp, name) char **bp, *name; { DBT key, data; - char *buf; - int st; key.data = name; key.size = strlen(name); @@ -741,7 +750,7 @@ cgetnext(bp, db_array) } } rp = buf; - for(cp = nbuf; *cp != NULL; cp++) + for(cp = nbuf; *cp != '\0'; cp++) if (*cp == '|' || *cp == ':') break; else