aboutsummaryrefslogtreecommitdiffstats
path: root/libabort_stralen.3
blob: d2ef0d958a47ae2eea78fe219c246c28b44f46d3 (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
.TH LIBABORT_STRALEN 3 LIBABORT
.SH NAME
libabort_stralen \- Get string length within a bounded size

.SH SYNOPSIS
.nf
#include <libabort.h>

size_t \fBlibabort_stralen\fP(const char *\fIstr\fP, size_t \fIsize\fP);

#if !defined(LIBABORT_NO_SHORTHANDS) && !defined(stralen)
# define \fBstralen\fP libabort_stralen
#endif
.fi

.SH DESCRIPTION
The
.BR libabort_stralen ()
function returns the length of the NUL terminated string
.I str
but will not read more than
.I size
bytes.
.PP
If no NUL terminator is found within the first
.I size
bytes, or if
.I size
is zero, the
.BR libabort_stralen ()
function calls
.BR abort (3).

.SH RETURN VALUE
The
.BR libabort_stralen ()
function returns the length of
.IR str .

.SH ERRORS
The
.BR libabort_stralen ()
function cannot fail.

.SH HISTORY
The
.BR libabort_stralen ()
function added in version 1.0 of
.BR libabort .

.SH SEE ALSO
.BR libabort (7),
.BR libabort_stpacat (3)