diff options
author | johan <johan@FreeBSD.org> | 2002-12-18 10:20:40 +0000 |
---|---|---|
committer | johan <johan@FreeBSD.org> | 2002-12-18 10:20:40 +0000 |
commit | 2d0e93bb2eab2533104a92a432361a0d75aae7da (patch) | |
tree | 1f91e920284acd6b620e70cad3a2cc39566c9692 /bin | |
parent | 5a92adf8bc83f1159a8f4ff04d850be8b9b67290 (diff) | |
download | FreeBSD-src-2d0e93bb2eab2533104a92a432361a0d75aae7da.zip FreeBSD-src-2d0e93bb2eab2533104a92a432361a0d75aae7da.tar.gz |
- use MAXPATHLEN per realpath(3)
- use the problematic part of the path, instead of the argument,
when reporting an error.
Reviewed by: mike
Diffstat (limited to 'bin')
-rw-r--r-- | bin/realpath/realpath.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/realpath/realpath.c b/bin/realpath/realpath.c index 57cbb97..c526733 100644 --- a/bin/realpath/realpath.c +++ b/bin/realpath/realpath.c @@ -46,7 +46,7 @@ static void usage(void) __dead2; int main(int argc, char *argv[]) { - char buf[PATH_MAX]; + char buf[MAXPATHLEN]; char *p; if (argc == 1) { @@ -54,7 +54,7 @@ main(int argc, char *argv[]) err(1, "getcwd()"); } else if (argc == 2) { if ((p = realpath(argv[1], buf)) == NULL) - err(1, "%s", argv[1]); + err(1, "%s", buf); } else usage(); (void)printf("%s\n", p); |