summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorespie <>1998-11-11 17:12:02 +0000
committerespie <>1998-11-11 17:12:02 +0000
commit83b8cc1cd7642ed303f194fbdd37577149acfb3e (patch)
tree530bf7f5757e67865ff49a212c2f83e1f2b5013f /src
parent7af4f54b73efee5df67dff662470166211acbb71 (diff)
downloadopenbsd-83b8cc1cd7642ed303f194fbdd37577149acfb3e.tar.gz
openbsd-83b8cc1cd7642ed303f194fbdd37577149acfb3e.tar.bz2
openbsd-83b8cc1cd7642ed303f194fbdd37577149acfb3e.zip
Fix `typo', proves that strlcpy/strlcat is a very good idea.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/string/strlcpy.311
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/libc/string/strlcpy.3 b/src/lib/libc/string/strlcpy.3
index 5ce444d6fa..1e46ef2e90 100644
--- a/src/lib/libc/string/strlcpy.3
+++ b/src/lib/libc/string/strlcpy.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: strlcpy.3,v 1.2 1998/07/06 19:17:21 millert Exp $ 1.\" $OpenBSD: strlcpy.3,v 1.3 1998/11/11 17:12:02 espie Exp $
2.\" 2.\"
3.\" Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> 3.\" Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
4.\" All rights reserved. 4.\" All rights reserved.
@@ -131,9 +131,16 @@ size_t n;
131n = strlcpy(pname, dir, sizeof(pname)); 131n = strlcpy(pname, dir, sizeof(pname));
132if (n >= sizeof(pname)) 132if (n >= sizeof(pname))
133 goto toolong; 133 goto toolong;
134if (strlcpy(pname + n, file, sizeof(pname)) >= sizeof(pname) - n) 134if (strlcpy(pname + n, file, sizeof(pname) - n) >= sizeof(pname) - n)
135 goto toolong; 135 goto toolong;
136.Ed 136.Ed
137.Pp
138However, one may question the validity of such optimizations, as they
139defeat the whole purpose of
140.Fn strlcpy
141and
142.Fn strlcat .
143As a matter of fact, the first version of this manual page got it wrong.
137.Sh SEE ALSO 144.Sh SEE ALSO
138.Xr snprintf 3 , 145.Xr snprintf 3 ,
139.Xr strncpy 3 , 146.Xr strncpy 3 ,