diff options
| author | Warner Losh <imp@FreeBSD.org> | 2001-05-29 18:20:36 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2001-05-29 18:20:36 +0000 |
| commit | 422a64eac7c27a4f3c7c8248ecc4f572c7b3a218 (patch) | |
| tree | feb74be152295eda4372a4df240e3b09b1f0f71b /bin | |
| parent | 22628ccf9684d86686386d4ceb677a7cddc0eaf4 (diff) | |
Notes
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/mv/mv.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 996e19d8393b..fe1d10d57ced 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) { |
