From 567b09a17d492426581db6d71ca654f3fcfe06f3 Mon Sep 17 00:00:00 2001 From: imp Date: Tue, 29 May 2001 18:20:36 +0000 Subject: Use PATH_MAX in preference to MAXPATHLEN. --- bin/mv/mv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bin/mv') diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 996e19d..fe1d10d 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -57,6 +57,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -82,7 +83,7 @@ main(argc, argv) register char *p, *endp; struct stat sb; int ch; - char path[MAXPATHLEN]; + char path[PATH_MAX]; while ((ch = getopt(argc, argv, "fiv")) != -1) switch (ch) { @@ -137,7 +138,7 @@ main(argc, argv) while (p != *argv && p[-1] != '/') --p; - if ((baselen + (len = strlen(p))) >= MAXPATHLEN) { + if ((baselen + (len = strlen(p))) >= PATH_MAX) { warnx("%s: destination pathname too long", *argv); rval = 1; } else { @@ -201,7 +202,7 @@ do_move(from, to) if (errno == EXDEV) { struct statfs sfs; - char path[MAXPATHLEN]; + char path[PATH_MAX]; /* Can't mv(1) a mount point. */ if (realpath(from, path) == NULL) { -- cgit v1.1