|
noexcept |
The function behaves identically to vsPrintfA except for the parameter cchDest and the explicit constraints listed in the remarks.
[out] | pDest | is a pointer to the output buffer where the converted string is to be written to. |
[in] | cchDest | is a size of the output buffer, in bytes, including the terminating zero. Unlike vsnPrintfA_s the function treats buffer overrun as an error, failing and setting the errno code to ENOBUFS. |
[in] | pszFormat | is a pointer to a zero terminated multibyte string defining how to interpret data, passed as additional parameters, during the construction of the output. See PrintfA_s for the definition of the format lexemes. |
[in] | ap | is a variable argument list containing data used to construct an output string according to the format. |
The function implements the behaviour of the vsprintf_s function that is described in the ISO/IEC TR 24731-1 standard offering security enhancements by specifying additional runtime constraints listed below.
If any of the constraints is violated the function generates an assertion and, if the execution is allowed to continue, returns zero number setting corresponding errno code. If an encoding error occurred the function returns a negative number.
On error, if pDest is not null and cchDest is greater than 0 and less than RSIZE_MAX, the function sets pDest[0] to the null character.
The corresponding original C function is vsprintf that has a corresponding chsvlib implementation sPrintfA.