|
|
@ -35,7 +35,7 @@ |
|
|
|
*/ |
|
|
|
|
|
|
|
#if defined(LIBC_SCCS) && !defined(lint) |
|
|
|
static char *rcsid = "$OpenBSD: realpath.c,v 1.3 1997/06/20 20:37:45 deraadt Exp $"; |
|
|
|
static char *rcsid = "$OpenBSD: realpath.c,v 1.4 1998/05/18 09:55:19 deraadt Exp $"; |
|
|
|
#endif /* LIBC_SCCS and not lint */ |
|
|
|
|
|
|
|
#include <sys/param.h> |
|
|
@ -105,7 +105,7 @@ loop: |
|
|
|
errno = ELOOP; |
|
|
|
goto err1; |
|
|
|
} |
|
|
|
n = readlink(p, resolved, MAXPATHLEN); |
|
|
|
n = readlink(p, resolved, MAXPATHLEN-1); |
|
|
|
if (n < 0) |
|
|
|
goto err1; |
|
|
|
resolved[n] = '\0'; |
|
|
|