safec
3.2
Safe C Library - ISO TR24731 Bounds Checking Interface
|
#include "safe_str_lib.h"
Functions | |
EXPORT int | sprintf_s (char *restrict dest, rsize_t dmax, const char *restrict fmt,...) |
The sprintf_s function composes a string with same test that would be printed if format was used on printf. More... | |
EXPORT int sprintf_s | ( | char *restrict | dest, |
rsize_t | dmax, | ||
const char *restrict | fmt, | ||
... | |||
) |
The sprintf_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.
[out] | dest | storage location for output buffer. |
[in] | dmax | maximum number of characters to store in buffer. |
[in] | fmt | format-control string. |
[in] | ... | optional arguments |
sprintf_s
function returns the number of characters written in the array, not counting the terminating null character. If an encoding error occurred, sprintf_s
returns a negative value. If any other runtime- constraint violation in vsnprintf
occurred, sprintf_s
returns zero. 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() . |