aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/kiss-readlink.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/kiss-readlink.c b/bin/kiss-readlink.c
index e65c0d9..cc6c8ff 100644
--- a/bin/kiss-readlink.c
+++ b/bin/kiss-readlink.c
@@ -9,6 +9,8 @@
#include <string.h>
#include <limits.h>
+#define DIR_MAX PATH_MAX - NAME_MAX - 1
+
char *realpath(const char *path, char *resolved_path);
@@ -22,7 +24,7 @@ main(int argc, char *argv[])
* use directories above the file. We are using dname and bname so that
* they don't clash with the functions with the same name.
*/
- char dname[PATH_MAX]; /* directory name */
+ char dname[DIR_MAX]; /* directory name */
char bname[NAME_MAX]; /* base name */
sprintf(bname, "%s", (basename(argv[1])));