From 7c545b4b9c31dbfb2e8430aded030654a92e967a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 28 Feb 2026 19:17:45 +0100 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libabort_stpacpy.3 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 libabort_stpacpy.3 (limited to 'libabort_stpacpy.3') diff --git a/libabort_stpacpy.3 b/libabort_stpacpy.3 new file mode 100644 index 0000000..3de9ea1 --- /dev/null +++ b/libabort_stpacpy.3 @@ -0,0 +1,56 @@ +.TH LIBABORT_STPACPY 3 LIBABORT +.SH NAME +libabort_stpacpy \- Copy a string with bounds checking + +.SH SYNOPSIS +.nf +#include + +char *\fBlibabort_stpacpy\fP(char *\fIdst\fP, const char *\fIsrc\fP, size_t \fIsize\fP); + +#if !defined(LIBABORT_NO_SHORTHANDS) && !defined(stpacpy) +# define \fBstpacpy\fP libabort_stpacpy +#endif +.fi +.PP +Link with +.IR -labort . + +.SH DESCRIPTION +The +.BR libabort_stpacpy () +function copies the NUL terminated string +.I src +into the buffer +.IR dst , +which is assumed to be +.I size +bytes long. +.PP +If the string does not fit in the destination buffer +(including the terminating NUL byte), the +.BR libabort_stpacpy () +function calls +.BR abort (3). + +.SH RETURN VALUE +The +.BR libabort_stpacpy () +function returns a pointer to the terminating NUL byte in +.IR dst . + +.SH ERRORS +The +.BR libabort_stpacpy () +function cannot fail. + +.SH HISTORY +The +.BR libabort_stpacpy () +function added in version 1.0 of +.BR libabort . + +.SH SEE ALSO +.BR libabort (7), +.BR libabort_stracpy (3), +.BR libabort_stpacat (3) -- cgit v1.2.3-70-g09d2