From afbd6e72e2f15939ef9ff4c3b500887e62eab7ba Mon Sep 17 00:00:00 2001 From: millert <> Date: Mon, 30 Sep 2013 12:02:35 +0000 Subject: [PATCH] Use PATH_MAX, NAME_MAX and LOGIN_NAME_MAX not MAXPATHNAMELEN, MAXNAMLEN or MAXLOGNAME where possible. OK deraadt@ --- src/lib/libc/string/strlcpy.3 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/libc/string/strlcpy.3 b/src/lib/libc/string/strlcpy.3 index a7cd2698..044c959c 100644 --- a/src/lib/libc/string/strlcpy.3 +++ b/src/lib/libc/string/strlcpy.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: strlcpy.3,v 1.25 2013/09/25 21:49:31 millert Exp $ +.\" $OpenBSD: strlcpy.3,v 1.26 2013/09/30 12:02:35 millert Exp $ .\" .\" Copyright (c) 1998, 2000 Todd C. Miller .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: September 25 2013 $ +.Dd $Mdocdate: September 30 2013 $ .Dt STRLCPY 3 .Os .Sh NAME @@ -138,7 +138,7 @@ char *s, *p, buf[BUFSIZ]; To detect truncation, perhaps while building a pathname, something like the following might be used: .Bd -literal -offset indent -char *dir, *file, pname[MAXPATHLEN]; +char *dir, *file, pname[PATH_MAX]; \&... @@ -151,7 +151,7 @@ if (strlcat(pname, file, sizeof(pname)) >= sizeof(pname)) Since it is known how many characters were copied the first time, things can be sped up a bit by using a copy instead of an append: .Bd -literal -offset indent -char *dir, *file, pname[MAXPATHLEN]; +char *dir, *file, pname[PATH_MAX]; size_t n; \&...