diff options
author | Peter Valchev <pvalchev@cvs.openbsd.org> | 2003-04-05 19:19:45 +0000 |
---|---|---|
committer | Peter Valchev <pvalchev@cvs.openbsd.org> | 2003-04-05 19:19:45 +0000 |
commit | 86de5cdeae2f2c4754534ce041eb70586b6bb789 (patch) | |
tree | 35ea3c7ac0c4a84b9a7074df3d8d32173fe5a875 | |
parent | a2882e85458e5f2b41d1b0e31db4f5d52e11ecc1 (diff) |
strlcat, strncpy; ok tedu henning
-rw-r--r-- | usr.sbin/amd/amd/mapc.c | 4 | ||||
-rw-r--r-- | usr.sbin/amd/fsinfo/fsi_lex.l | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/amd/amd/mapc.c b/usr.sbin/amd/amd/mapc.c index 354bf7f34fc..aafc81132a0 100644 --- a/usr.sbin/amd/amd/mapc.c +++ b/usr.sbin/amd/amd/mapc.c @@ -38,7 +38,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)mapc.c 8.1 (Berkeley) 6/6/93";*/ -static char *rcsid = "$Id: mapc.c,v 1.8 2003/03/13 22:08:02 deraadt Exp $"; +static char *rcsid = "$Id: mapc.c,v 1.9 2003/04/05 19:19:44 pvalchev Exp $"; #endif /* not lint */ /* @@ -685,7 +685,7 @@ mapc_meta_search(mnt_map *m, char *key, char **pval, int recurse) */ strlcpy(wildname, key, sizeof wildname); while (error && (subp = strrchr(wildname, '/'))) { - strcpy(subp, "/*"); /* ok */ + strncpy(subp, "/*", 2); #ifdef DEBUG dlog("mapc recurses on %s", wildname); #endif diff --git a/usr.sbin/amd/fsinfo/fsi_lex.l b/usr.sbin/amd/fsinfo/fsi_lex.l index 24e436cd5dd..509d3d209ae 100644 --- a/usr.sbin/amd/fsinfo/fsi_lex.l +++ b/usr.sbin/amd/fsinfo/fsi_lex.l @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * from: @(#)fsi_lex.l 8.2 (Berkeley) 2/17/94 - * $Id: fsi_lex.l,v 1.2 2001/01/02 20:01:34 mickey Exp $ + * $Id: fsi_lex.l,v 1.3 2003/04/05 19:19:44 pvalchev Exp $ */ /* @@ -245,15 +245,15 @@ static int first = 1; error("\"%s\": Cannot open for reading", *g_argv); file_io_errors++; } else { - strcat(prog, *g_argv); - strcat(prog, " "); + strlcat(prog, *g_argv, sizeof(prog)); + strlcat(prog, " ", sizeof(prog)); } } - strcat(prog, "; do /usr/bin/cpp "); - strcat(prog, idvbuf); - strcat(prog, " -DHOSTNAME=\'"); - strcat(prog, hostname); - strcat(prog, "\' \"$file\"; done"); + strlcat(prog, "; do /usr/bin/cpp ", sizeof(prog)); + strlcat(prog, idvbuf, sizeof(prog)); + strlcat(prog, " -DHOSTNAME=\'", sizeof(prog)); + strlcat(prog, hostname, sizeof(prog)); + strlcat(prog, "\' \"$file\"; done", sizeof(prog)); yyin = popen(prog, "r"); if (yyin) { /*if (filename) free(filename);*/ |