Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/lib/libc/gen/getcwd.c,v retrieving revision 1.25.2.2 retrieving revision 1.26 diff -u -p -r1.25.2.2 -r1.26 --- src/lib/libc/gen/getcwd.c 2004/05/11 12:23:04 1.25.2.2 +++ src/lib/libc/gen/getcwd.c 2002/10/19 18:58:32 1.26 @@ -1,4 +1,4 @@ -/* $NetBSD: getcwd.c,v 1.25.2.2 2004/05/11 12:23:04 tron Exp $ */ +/* $NetBSD: getcwd.c,v 1.26 2002/10/19 18:58:32 provos Exp $ */ /* * Copyright (c) 1989, 1991, 1993, 1995 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)getcwd.c 8.5 (Berkeley) 2/7/95"; #else -__RCSID("$NetBSD: getcwd.c,v 1.25.2.2 2004/05/11 12:23:04 tron Exp $"); +__RCSID("$NetBSD: getcwd.c,v 1.26 2002/10/19 18:58:32 provos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -170,8 +170,7 @@ loop: rootd = 0; if (*wbuf) { - if (strlen(resolved) + strlen(wbuf) + (rootd ? 0 : 1) + 1 > - MAXPATHLEN) { + if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) { errno = ENAMETOOLONG; goto err1; }