diff options
| author | Mattias Andrée <m@maandree.se> | 2026-02-28 19:17:45 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-02-28 19:17:45 +0100 |
| commit | 7c545b4b9c31dbfb2e8430aded030654a92e967a (patch) | |
| tree | cd79fb055bfcca79dee8b1b35c0ed59ea3a0c85a /libabort_stpacat.3 | |
| download | libabort-master.tar.gz libabort-master.tar.bz2 libabort-master.tar.xz | |
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
| -rw-r--r-- | libabort_stpacat.3 | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/libabort_stpacat.3 b/libabort_stpacat.3 new file mode 100644 index 0000000..2efdc23 --- /dev/null +++ b/libabort_stpacat.3 @@ -0,0 +1,61 @@ +.TH LIBABORT_STPACAT 3 LIBABORT +.SH NAME +libabort_stpacat \- Append a string with bounds checking + +.SH SYNOPSIS +.nf +#include <libabort.h> + +char *\fBlibabort_stpacat\fP(char *\fIdst\fP, const char *\fIsrc\fP, size_t \fIsize\fP); + +#if !defined(LIBABORT_NO_SHORTHANDS) && !defined(stpacat) +# define \fBstpacat\fP libabort_stpacat +#endif +.fi +.PP +Link with +.IR -labort . + +.SH DESCRIPTION +The +.BR libabort_stpacat () +function appends the NUL terminated string +.I src +to the NUL terminated string +.I dst +which is assumed to refer to a buffer of +.I size +bytes. +.PP +The function verifies that the concatenated +string fits in the destination buffer +(including the terminating NUL). If the +destination buffer is too small, or if +.I dst +is not NUL terminated within the first +.I size +bytes, the +.BR libabort_stpacat () +function calls +.BR abort (3). + +.SH RETURN VALUE +The +.BR libabort_stpacat () +function returns a pointer to the terminating NUL byte of the +resulting string. + +.SH ERRORS +The +.BR libabort_stpacat () +function cannot fail. + +.SH HISTORY +The +.BR libabort_stpacat () +function added in version 1.0 of +.BR libabort . + +.SH SEE ALSO +.BR libabort (7), +.BR libabort_stralen (3) |
