diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-24 21:22:38 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-24 21:22:38 +0000 |
commit | 614d3b268363cdee32aba3cafe8e123fe69ac75d (patch) | |
tree | 9662f1a62a0bd0d9512daf0fa448d0a7f051956a /lib/libc/stdlib | |
parent | 899eab9f01ad712357176d191d1b6a49639c11e3 (diff) |
try to use strlcpy and snprintf more; ok various
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r-- | lib/libc/stdlib/realpath.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c index 061f1a7ef12..d01b19e0f2e 100644 --- a/lib/libc/stdlib/realpath.c +++ b/lib/libc/stdlib/realpath.c @@ -35,7 +35,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: realpath.c,v 1.6 2002/01/12 16:24:35 millert Exp $"; +static char *rcsid = "$OpenBSD: realpath.c,v 1.7 2002/05/24 21:22:37 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -66,7 +66,7 @@ realpath(path, resolved) /* Save the starting point. */ if ((fd = open(".", O_RDONLY)) < 0) { - (void)strcpy(resolved, "."); + (void)strlcpy(resolved, ".", MAXPATHLEN); return (NULL); } @@ -125,7 +125,7 @@ loop: * Save the last component name and get the full pathname of * the current directory. */ - (void)strcpy(wbuf, p); + (void)strlcpy(wbuf, p, sizeof wbuf); if (getcwd(resolved, MAXPATHLEN) == 0) goto err1; |