Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F176129185
D27228.id82952.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D27228.id82952.diff
View Options
Index: lib/libc/string/strlcpy.3
===================================================================
--- lib/libc/string/strlcpy.3
+++ lib/libc/string/strlcpy.3
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 1, 2020
+.Dd January 26, 2021
.Dt STRLCPY 3
.Os
.Sh NAME
@@ -47,9 +47,11 @@
.Fn strlcpy
and
.Fn strlcat
-functions copy and concatenate strings with the
-same input parameters and output result as
-.Xr snprintf 3 .
+functions copy and concatenate strings with the same input parameters and output result as
+.Xr strcpy 3
+and
+.Xr strcat 3
+with proper overflow protection.
They are designed to be safer, more consistent, and less error
prone replacements for the easily misused functions
.Xr strncpy 3
@@ -102,22 +104,7 @@
.Fa dst
strings overlap, the behavior is undefined.
.Sh RETURN VALUES
-Besides quibbles over the return type
-.Pf ( Va size_t
-versus
-.Va int )
-and signal handler safety
-.Pf ( Xr snprintf 3
-is not entirely safe on some systems), the
-following two are equivalent:
-.Bd -literal -offset indent
-n = strlcpy(dst, src, len);
-n = snprintf(dst, len, "%s", src);
-.Ed
-.Pp
-Like
-.Xr snprintf 3 ,
-the
+The
.Fn strlcpy
and
.Fn strlcat
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 17, 8:19 AM (12 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40938452
Default Alt Text
D27228.id82952.diff (1 KB)
Attached To
Mode
D27228: strlcpy/strlcat: Remove references to snprintf
Attached
Detach File
Event Timeline
Log In to Comment