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_vsaprintf.3 | |
| download | libabort-390b29925136589c6eae0bb5e78cc7f3d818ee28.tar.gz libabort-390b29925136589c6eae0bb5e78cc7f3d818ee28.tar.bz2 libabort-390b29925136589c6eae0bb5e78cc7f3d818ee28.tar.xz | |
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libabort_vsaprintf.3')
| -rw-r--r-- | libabort_vsaprintf.3 | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/libabort_vsaprintf.3 b/libabort_vsaprintf.3 new file mode 100644 index 0000000..8fbd385 --- /dev/null +++ b/libabort_vsaprintf.3 @@ -0,0 +1,58 @@ +.TH LIBABORT_VSAPRINTF 3 LIBABORT +.SH NAME +libabort_vsaprintf \- Format a string with bounds checking + +.SH SYNOPSIS +.nf +#include <libabort.h> + +int \fBlibabort_vsaprintf\fP(char *\fIbuf\fP, size_t \fIsize\fP, const char *\fIfmt\fP, va_list \fIap\fP); + +#if !defined(LIBABORT_NO_SHORTHANDS) && !defined(vsaprintf) +# define \fBvsaprintf\fP libabort_vsaprintf +#endif +.fi +.PP +Link with +.IR -labort . + +.SH DESCRIPTION +The +.BR libabort_vsaprintf () +function formats a string according to +.I fmt +into the buffer +.IR buf , +which is assumed to be +.I size +bytes long. +.PP +If the formatted output does not fit in the destination buffer +(including the terminating NUL byte), or if +.I size +is zero, the +.BR libabort_vsaprintf () +function calls +.BR abort (3). + +.SH RETURN VALUE +The +.BR libabort_vsaprintf () +function returns the number of bytes written to +.IR buf , +excluding the terminating NUL byte. + +.SH ERRORS +The +.BR libabort_vsaprintf () +function cannot fail. + +.SH HISTORY +The +.BR libabort_vsaprintf () +function added in version 1.0 of +.BR libabort . + +.SH SEE ALSO +.BR libabort (7), +.BR libabort_saprintf (3) |
