summaryrefslogtreecommitdiffstats
path: root/bin/rcp
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-05-30 03:33:32 +0000
committerimp <imp@FreeBSD.org>2001-05-30 03:33:32 +0000
commit8c99d1db67a3a75b87ef9e75ec5e09d8233d937e (patch)
treeb97c09dcde325267cfb824b2c37eff36acef0ce5 /bin/rcp
parent32b1a4110cf1de04556b2d40372860d40cfa9fd3 (diff)
downloadFreeBSD-src-8c99d1db67a3a75b87ef9e75ec5e09d8233d937e.zip
FreeBSD-src-8c99d1db67a3a75b87ef9e75ec5e09d8233d937e.tar.gz
Use PATH_MAX instead of MAXPATHLEN.
Also use sizeof(path) in preference to PATH_MAX.
Diffstat (limited to 'bin/rcp')
-rw-r--r--bin/rcp/rcp.c7
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;
}
OpenPOWER on IntegriCloud