use readlink with bufsize - 1, From NetBSD

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11662 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2003-02-25 10:51:30 +00:00
parent 06f8ef9060
commit 5d97c60219

View File

@@ -268,7 +268,7 @@ make_fileinfo(FILE *out, const char *filename, struct fileinfo *file, int flags)
}
if(S_ISLNK(st->st_mode)) {
int n;
n = readlink((char *)filename, buf, sizeof(buf));
n = readlink((char *)filename, buf, sizeof(buf) - 1);
if(n >= 0) {
buf[n] = '\0';
file->link = strdup(buf);