summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2022-12-04 23:49:08 +0100
committerAlejandro Colomar <alx@kernel.org>2022-12-04 23:49:08 +0100
commit413180217085dcb45ddf756511be7ad1e681cec0 (patch)
treed0bbc630a145f775314b70177f2e083daedf9798
parent0236da4ad36e739b4996850e29ff927d79809ba2 (diff)
strncpy.3: CAVEATS: It can't detect truncation
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man3/strncpy.37
1 files changed, 7 insertions, 0 deletions
diff --git a/man3/strncpy.3 b/man3/strncpy.3
index 2f9913879..7587c036f 100644
--- a/man3/strncpy.3
+++ b/man3/strncpy.3
@@ -105,6 +105,13 @@ interprocess communication technique).
has a misleading name.
It doesn't produce a (null-terminated) string;
and it should never be used for producing a string.
+.PP
+It can't detect truncation.
+It's probably better to explicitly call
+.BR bzero (3)
+and
+.BR memccpy (3),
+since that allows detecting truncation.
.SH SEE ALSO
.BR bzero (3),
.BR memccpy (3),