safec  3.6.0
Safe C Library - ISO TR24731 Bounds Checking Interface
fprintf_s.c File Reference
#include "safe_lib.h"
+ Include dependency graph for fprintf_s.c:

Functions

EXPORT int fprintf_s (FILE *restrict stream, const char *restrict fmt,...)
 The fprintf_s function composes a string via the format string and writes it to a FILE buffer. More...
 

Function Documentation

◆ fprintf_s()

EXPORT int fprintf_s ( FILE *restrict  stream,
const char *restrict  fmt,
  ... 
)

The fprintf_s function composes a string via the format string and writes it to a FILE buffer.

Note
POSIX specifies that errno is set on error. However, the safeclib extended ES* errors do not set errno, only when the underlying system vfprintf call fails, errno is set.
Remarks
SPECIFIED IN
Parameters
[out]streamoutput file stream to write to
[in]fmtformat-control string.
[in]...optional arguments
Precondition
Neither stream nor fmt shall be a null pointer.
fmt shall not contain the conversion specifier n.
None of the arguments corresponding to s is a null pointer. (not yet)
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
-ESNULLPwhen stream/fmt is NULL pointer
-EINVALwhen fmt contains n
-1on some other error. errno is set then.