$NetBSD: patch-bb,v 1.1 2005/12/27 14:00:53 joerg Exp $ --- lib/ftw/ftw.c.orig 2005-12-18 22:14:06.000000000 +0000 +++ lib/ftw/ftw.c @@ -19,6 +19,7 @@ * recycle file descriptors. */ +#include #include #include "cdialect.h" #include @@ -71,7 +72,11 @@ ftw(directory, funcptr, depth) /* Get ready to hold the full paths. */ i = strlen(directory); +#ifdef NAME_MAX + fullpath = (char *)malloc(i + 1 + NAME_MAX + 1); +#else fullpath = (char *)malloc(i + 1 + MAXNAMLEN + 1); +#endif if (fullpath == NULL) { closedir(dirp); return -1;