]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man3/memccpy.3: CAVEATS: Document that this function is not appropriate for strings
authorAlejandro Colomar <alx@kernel.org>
Mon, 3 Aug 2026 00:14:10 +0000 (02:14 +0200)
committerAlejandro Colomar <alx@kernel.org>
Mon, 3 Aug 2026 00:14:12 +0000 (02:14 +0200)
Cc: Keith Bostic <keith@bostic.com>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Sam James <sam@gentoo.org>
Cc: Joseph Myers <josmyers@redhat.com>
Cc: Mark Harris <mark.hsj@gmail.com>
Cc: Nevin Liber <nevin@cplusplusguy.com>
Cc: Collin Funk <collin.funk1@gmail.com>
Cc: JeanHeyd Meneide <phdofthehouse@gmail.com>
Cc: Christopher Bazley <chris.bazley.wg14@gmail.com>
Cc: Bruno Haible <bruno@clisp.org>
Cc: Paul Eggert <eggert@cs.ucla.edu>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Evgeny Grin <k2k@drgrin.dev>
Cc: Kees Cook <keescook@chromium.org>
Cc: Steve Summit <scs@eskimo.com>
Cc: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: Arsen Arsenović <arsen@aarsen.me>
Cc: bug-gnulib@gnu.org
Cc: libc-alpha@sourceware.org
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man3/memccpy.3

index e28650991cc22e85486a3baf7db51c97fcb0937a..ed194d26654ef516e57147f0c9c1679dc274f933 100644 (file)
@@ -74,6 +74,14 @@ see
 .BR memory.h (3head).
 .SH HISTORY
 POSIX.1-2001, SVr4, 4.3BSD.
+.SH CAVEATS
+This function has recently (since C23)
+started being misused for copying strings with truncation.
+That's not its intended use,
+and is most likely to result in bugs if used for that.
+This function was designed for
+the quite different (and niche) task of implementing
+.BR fgets (3).
 .SH SEE ALSO
 .BR memory.h (3head),
 .BR bcopy (3),