blob: 2efdc23357151867bbf095059ecfd7694532cd17 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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)
|