aboutsummaryrefslogtreecommitdiffstats
path: root/libabort_stralen.3
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-02-28 19:17:45 +0100
committerMattias Andrée <m@maandree.se>2026-02-28 19:17:45 +0100
commit7c545b4b9c31dbfb2e8430aded030654a92e967a (patch)
treecd79fb055bfcca79dee8b1b35c0ed59ea3a0c85a /libabort_stralen.3
downloadlibabort-390b29925136589c6eae0bb5e78cc7f3d818ee28.tar.gz
libabort-390b29925136589c6eae0bb5e78cc7f3d818ee28.tar.bz2
libabort-390b29925136589c6eae0bb5e78cc7f3d818ee28.tar.xz
First commitHEAD1.0master
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libabort_stralen.3')
-rw-r--r--libabort_stralen.353
1 files changed, 53 insertions, 0 deletions
diff --git a/libabort_stralen.3 b/libabort_stralen.3
new file mode 100644
index 0000000..d2ef0d9
--- /dev/null
+++ b/libabort_stralen.3
@@ -0,0 +1,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)