From 81e005b0e7660ee58f28998425a2513ff3234fdc Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 18 May 1998 20:37:20 +0000 Subject: readlink len-1 --- bin/csh/dir.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/csh/dir.c b/bin/csh/dir.c index c53bb55c9ff..6143fbc552f 100644 --- a/bin/csh/dir.c +++ b/bin/csh/dir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.c,v 1.3 1997/07/25 18:58:00 mickey Exp $ */ +/* $OpenBSD: dir.c,v 1.4 1998/05/18 20:37:19 deraadt Exp $ */ /* $NetBSD: dir.c,v 1.9 1995/03/21 09:02:42 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)dir.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: dir.c,v 1.3 1997/07/25 18:58:00 mickey Exp $"; +static char rcsid[] = "$OpenBSD: dir.c,v 1.4 1998/05/18 20:37:19 deraadt Exp $"; #endif #endif /* not lint */ @@ -708,7 +708,7 @@ dcanon(cp, p) *--sp = 0; /* form the pathname for readlink */ if (sp != cp && !adrof(STRignore_symlinks) && (cc = readlink(short2str(cp), tlink, - sizeof tlink)) >= 0) { + sizeof tlink-1)) >= 0) { (void) Strcpy(link, str2short(tlink)); link[cc] = '\0'; @@ -793,7 +793,7 @@ dcanon(cp, p) if (sp != cp && adrof(STRchase_symlinks) && !adrof(STRignore_symlinks) && (cc = readlink(short2str(cp), tlink, - sizeof tlink)) >= 0) { + sizeof tlink-1)) >= 0) { (void) Strcpy(link, str2short(tlink)); link[cc] = '\0'; -- cgit v1.2.3