summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree/compare.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1998-06-09 05:02:29 +0000
committerimp <imp@FreeBSD.org>1998-06-09 05:02:29 +0000
commiteba733f6ce5828610ebb5ad5135df36092373463 (patch)
tree9e3334273a153c68525736ac9b8276738ae792cf /usr.sbin/mtree/compare.c
parent87738602a9bddfd717b3fb188735bbd8b570eee0 (diff)
downloadFreeBSD-src-eba733f6ce5828610ebb5ad5135df36092373463.zip
FreeBSD-src-eba733f6ce5828610ebb5ad5135df36092373463.tar.gz
Use correct size for readlink buffer. This is the size of the
buffer -1 since readlink adds its own NUL to the end. Inspired by: Similar changes in OpenBSD
Diffstat (limited to 'usr.sbin/mtree/compare.c')
-rw-r--r--usr.sbin/mtree/compare.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/mtree/compare.c b/usr.sbin/mtree/compare.c
index 72b00b9..760bf64 100644
--- a/usr.sbin/mtree/compare.c
+++ b/usr.sbin/mtree/compare.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: compare.c,v 1.8 1997/10/01 06:30:00 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -288,7 +288,7 @@ rlink(name)
static char lbuf[MAXPATHLEN];
register int len;
- if ((len = readlink(name, lbuf, sizeof(lbuf))) == -1)
+ if ((len = readlink(name, lbuf, sizeof(lbuf) - 1)) == -1)
err(1, "line %d: %s", lineno, name);
lbuf[len] = '\0';
return (lbuf);
OpenPOWER on IntegriCloud