The printf_s function composes a string via the format string and writes it to the STDOUT file.
- Note
- POSIX specifies that
errno is set on error. However, the safeclib extended ES* errors do not set errno, only when the underlying system vprintf call fails, errno is set.
- Parameters
-
| [in] | fmt | format-control string |
| [in] | ... | optional arguments |
- Precondition
- fmt shall not be a null pointer.
-
fmt shall not contain the conversion specifier n.
-
None of the arguments corresponding to s is a null pointer.
-
No encoding error shall occur.
- Returns
- On success the total number of characters written is returned.
-
On failure a negative number is returned.
- Return values
-
| -ESNULLP | when fmt is NULL pointer |
| -EINVAL | when fmt contains n |
| -1 | on some other error. errno might be set then. |