diff options
Diffstat (limited to 'bin/rcp')
-rw-r--r-- | bin/rcp/rcp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c index 8f413bd..3a09ab4 100644 --- a/bin/rcp/rcp.c +++ b/bin/rcp/rcp.c @@ -58,6 +58,8 @@ static const char rcsid[] = #include <err.h> #include <errno.h> #include <fcntl.h> +#include <libutil.h> +#include <limits.h> #include <netdb.h> #include <pwd.h> #include <signal.h> @@ -66,7 +68,6 @@ static const char rcsid[] = #include <string.h> #include <string.h> #include <unistd.h> -#include <libutil.h> #include "pathnames.h" #include "extern.h" @@ -514,7 +515,7 @@ rsource(name, statp) { DIR *dirp; struct dirent *dp; - char *last, *vect[1], path[MAXPATHLEN]; + char *last, *vect[1], path[PATH_MAX]; if (!(dirp = opendir(name))) { run_err("%s: %s", name, strerror(errno)); @@ -547,7 +548,7 @@ rsource(name, statp) continue; if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) continue; - if (strlen(name) + 1 + strlen(dp->d_name) >= MAXPATHLEN - 1) { + if (strlen(name) + 1 + strlen(dp->d_name) >= sizeof(path)) { run_err("%s/%s: name too long", name, dp->d_name); continue; } |