summaryrefslogtreecommitdiffstats
path: root/bin/mv
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-05-29 18:20:36 +0000
committerimp <imp@FreeBSD.org>2001-05-29 18:20:36 +0000
commit567b09a17d492426581db6d71ca654f3fcfe06f3 (patch)
tree8ddcb7711c64956f7e8c90c09d3d8a3120b1024d /bin/mv
parent8e6e314c51990c1d64dfa814a6cbea08da042bd2 (diff)
downloadFreeBSD-src-567b09a17d492426581db6d71ca654f3fcfe06f3.zip
FreeBSD-src-567b09a17d492426581db6d71ca654f3fcfe06f3.tar.gz
Use PATH_MAX in preference to MAXPATHLEN.
Diffstat (limited to 'bin/mv')
-rw-r--r--bin/mv/mv.c7
1 files changed, 4 insertions, 3 deletions
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 <err.h>
#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -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) {
OpenPOWER on IntegriCloud