safec
3.0
Safe C Library - ISO TR24731 Bounds Checking Interface
|
#include "safe_str_lib.h"
Functions | |
EXPORT int | vsprintf_s (char *restrict dest, rsize_t dmax, const char *restrict fmt, va_list ap) |
The vsprintf_s function composes a string with same test that would be printed if format was used on printf . More... | |
EXPORT int vsprintf_s | ( | char *restrict | dest, |
rsize_t | dmax, | ||
const char *restrict | fmt, | ||
va_list | ap | ||
) |
The vsprintf_s
function composes a string with same test that would be printed if format was used on printf
.
Instead of being printed, the content is stored in dest. With SAFECLIB_STR_NULL_SLACK defined all elements following the terminating null character (if any) written by vsprintf_s in the array of dmax
characters pointed to by dest are nulled when vsprintf_s
returns.
[out] | dest | pointer to string that will be written into. |
[in] | dmax | restricted maximum length of dest |
[in] | fmt | format-control string. |
[in] | ap | optional arguments |
errno: ESNULLP when dest/fmt
is NULL pointer ESZEROL when dmax
= 0 ESLEMAX when dmax
> RSIZE_MAX_STR
ESNOSPC when return value exceeds dmax EINVAL when fmt
contains n
-1 | if an encoding error occurred or the return buffer size exceeds dmax. |
0 | on some other error in vsnprintf() . |