diff --git a/appl/ftp/ftpd/ls.c b/appl/ftp/ftpd/ls.c index a0f12ce8b..30d8f93a0 100644 --- a/appl/ftp/ftpd/ls.c +++ b/appl/ftp/ftpd/ls.c @@ -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);