diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-05-18 09:58:06 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-05-18 09:58:06 +0000 |
commit | e9bade226727715b23b7b2153ae13d8b6678df39 (patch) | |
tree | 921b9d47969ca1996be94a9d11773d2484acc921 /bin/cp | |
parent | b169e69c1f4e1946e52a3fd585944c7175263fac (diff) |
readlink(path, buf, sizeof buf-1). Never forget that -1.
Diffstat (limited to 'bin/cp')
-rw-r--r-- | bin/cp/utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/cp/utils.c b/bin/cp/utils.c index d6b606cd47e..9a9a18b79ce 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.c,v 1.10 1997/11/08 23:17:12 todd Exp $ */ +/* $OpenBSD: utils.c,v 1.11 1998/05/18 09:58:05 deraadt Exp $ */ /* $NetBSD: utils.c,v 1.6 1997/02/26 14:40:51 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94"; #else -static char rcsid[] = "$OpenBSD: utils.c,v 1.10 1997/11/08 23:17:12 todd Exp $"; +static char rcsid[] = "$OpenBSD: utils.c,v 1.11 1998/05/18 09:58:05 deraadt Exp $"; #endif #endif /* not lint */ @@ -187,7 +187,7 @@ copy_link(p, exists) int len; char link[MAXPATHLEN]; - if ((len = readlink(p->fts_path, link, sizeof(link))) == -1) { + if ((len = readlink(p->fts_path, link, sizeof(link)-1)) == -1) { warn("readlink: %s", p->fts_path); return (1); } |