summaryrefslogtreecommitdiff
path: root/openbsd-compat/realpath.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-07-07 22:07:10 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-07-07 22:07:10 +0000
commit8abe736dd7a27e4c2a42351287bacfd80ec42a7c (patch)
tree5fc92aa71f92f5d768ed11880f08ea3a31b9bd77 /openbsd-compat/realpath.c
parente475a3cf3b18ce1c22529fdf2d531beee5ea8f25 (diff)
- (bal) [realpath.c] Updated with OpenBSD tree.
Diffstat (limited to 'openbsd-compat/realpath.c')
-rw-r--r--openbsd-compat/realpath.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsd-compat/realpath.c b/openbsd-compat/realpath.c
index b4a05db95..b9035ca22 100644
--- a/openbsd-compat/realpath.c
+++ b/openbsd-compat/realpath.c
@@ -32,7 +32,7 @@
32#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) 32#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
33 33
34#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
35static char *rcsid = "$OpenBSD: realpath.c,v 1.6 2002/01/12 16:24:35 millert Exp $"; 35static char *rcsid = "$OpenBSD: realpath.c,v 1.7 2002/05/24 21:22:37 deraadt Exp $";
36#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
37 37
38#include <sys/param.h> 38#include <sys/param.h>
@@ -69,7 +69,7 @@ realpath(const char *path, char *resolved)
69 /* Save the starting point. */ 69 /* Save the starting point. */
70 getcwd(start,MAXPATHLEN); 70 getcwd(start,MAXPATHLEN);
71 if ((fd = open(".", O_RDONLY)) < 0) { 71 if ((fd = open(".", O_RDONLY)) < 0) {
72 (void)strcpy(resolved, "."); 72 (void)strlcpy(resolved, ".", MAXPATHLEN);
73 return (NULL); 73 return (NULL);
74 } 74 }
75 close(fd); 75 close(fd);
@@ -129,7 +129,7 @@ loop:
129 * Save the last component name and get the full pathname of 129 * Save the last component name and get the full pathname of
130 * the current directory. 130 * the current directory.
131 */ 131 */
132 (void)strcpy(wbuf, p); 132 (void)strlcpy(wbuf, p, sizeof wbuf);
133 if (getcwd(resolved, MAXPATHLEN) == 0) 133 if (getcwd(resolved, MAXPATHLEN) == 0)
134 goto err1; 134 goto err1;
135 135