diff options
author | jedgar <jedgar@FreeBSD.org> | 2001-01-17 20:51:20 +0000 |
---|---|---|
committer | jedgar <jedgar@FreeBSD.org> | 2001-01-17 20:51:20 +0000 |
commit | 168082bf380dab46aa447d1a57fc102165e474df (patch) | |
tree | 174f244d9da9eef8e84a9d68891465f6f90e3dab /lib | |
parent | 3644801234941af6cb5e5938772a7d92049f3ee5 (diff) | |
download | FreeBSD-src-168082bf380dab46aa447d1a57fc102165e474df.zip FreeBSD-src-168082bf380dab46aa447d1a57fc102165e474df.tar.gz |
Clarify comments referring to strlcat() usage
Obtained from: OpenBSD
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/string/strlcpy.3 | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/libc/string/strlcpy.3 b/lib/libc/string/strlcpy.3 index bc20d45..c26a6f3 100644 --- a/lib/libc/string/strlcpy.3 +++ b/lib/libc/string/strlcpy.3 @@ -59,8 +59,29 @@ and take the full size of the buffer (not just the length) and guarantee to NUL-terminate the result (as long as .Fa size -is larger than 0). Note that you should include a byte for the NUL in +is larger than 0 or, in the case of +.Fn strlcat , +as long as there is at least one byte free in +.Fa dst ) . +Note that you should include a byte for the NUL in .Fa size . +Also note that +.Fn strlcpy +and +.Fn strlcat +only operate on true +.Dq C +strings. +This means that for +.Fn strlcpy +.Fa src +must be NUL-terminated and for +.Fn strlcat +both +.Fa src +and +.Fa dst +must be NUL-terminated. .Pp The .Fn strlcpy |