summaryrefslogtreecommitdiff
path: root/usr.bin/readlink
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-05-18 19:13:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-05-18 19:13:40 +0000
commitd51d6214fa2abd8ab575dfad3ef0690ab2a096d6 (patch)
treed11a883bf092b8f77001a674d42769deeb1a3367 /usr.bin/readlink
parentef77d4ef152a7f3529fa71b2c2eaedb17241d696 (diff)
readlink len-1
Diffstat (limited to 'usr.bin/readlink')
-rw-r--r--usr.bin/readlink/readlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/readlink/readlink.c b/usr.bin/readlink/readlink.c
index 51abac3dcf6..603d4bb0bcb 100644
--- a/usr.bin/readlink/readlink.c
+++ b/usr.bin/readlink/readlink.c
@@ -1,5 +1,5 @@
/*
- * $OpenBSD: readlink.c,v 1.13 1997/11/18 22:52:10 niklas Exp $
+ * $OpenBSD: readlink.c,v 1.14 1998/05/18 19:12:03 deraadt Exp $
*
* Copyright (c) 1997
* Kenneth Stailey (hereinafter referred to as the author)
@@ -71,7 +71,7 @@ main(argc, argv)
if (fflag)
realpath(argv[0], buf);
- else if ((n = readlink(argv[0], buf, PATH_MAX)) < 0)
+ else if ((n = readlink(argv[0], buf, sizeof buf-1)) < 0)
exit(1);
buf[n] = '\0';