diff options
| author | deraadt <> | 1998-05-18 09:55:19 +0000 | 
|---|---|---|
| committer | deraadt <> | 1998-05-18 09:55:19 +0000 | 
| commit | 9e2f66dbed2934fd5d9fb26b81ba24f437e9ae31 (patch) | |
| tree | 6ef9b4de192137da4d15d10dccf22d1af4587362 /src/lib/libc/stdlib | |
| parent | 843d26fb73ccffa5878005ce9ab0f7c0b7b75f6d (diff) | |
| download | openbsd-9e2f66dbed2934fd5d9fb26b81ba24f437e9ae31.tar.gz openbsd-9e2f66dbed2934fd5d9fb26b81ba24f437e9ae31.tar.bz2 openbsd-9e2f66dbed2934fd5d9fb26b81ba24f437e9ae31.zip | |
readlink(path, buf, sizeof buf-1).  Never forget that -1.
Diffstat (limited to 'src/lib/libc/stdlib')
| -rw-r--r-- | src/lib/libc/stdlib/realpath.c | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/src/lib/libc/stdlib/realpath.c b/src/lib/libc/stdlib/realpath.c index 78c286014d..0288601464 100644 --- a/src/lib/libc/stdlib/realpath.c +++ b/src/lib/libc/stdlib/realpath.c | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | */ | 35 | */ | 
| 36 | 36 | ||
| 37 | #if defined(LIBC_SCCS) && !defined(lint) | 37 | #if defined(LIBC_SCCS) && !defined(lint) | 
| 38 | static char *rcsid = "$OpenBSD: realpath.c,v 1.3 1997/06/20 20:37:45 deraadt Exp $"; | 38 | static char *rcsid = "$OpenBSD: realpath.c,v 1.4 1998/05/18 09:55:19 deraadt Exp $"; | 
| 39 | #endif /* LIBC_SCCS and not lint */ | 39 | #endif /* LIBC_SCCS and not lint */ | 
| 40 | 40 | ||
| 41 | #include <sys/param.h> | 41 | #include <sys/param.h> | 
| @@ -105,7 +105,7 @@ loop: | |||
| 105 | errno = ELOOP; | 105 | errno = ELOOP; | 
| 106 | goto err1; | 106 | goto err1; | 
| 107 | } | 107 | } | 
| 108 | n = readlink(p, resolved, MAXPATHLEN); | 108 | n = readlink(p, resolved, MAXPATHLEN-1); | 
| 109 | if (n < 0) | 109 | if (n < 0) | 
| 110 | goto err1; | 110 | goto err1; | 
| 111 | resolved[n] = '\0'; | 111 | resolved[n] = '\0'; | 
