safec
3.0
Safe C Library - ISO TR24731 Bounds Checking Interface
|
#include "safe_lib.h"
Functions | |
EXPORT errno_t | asctime_s (char *dest, rsize_t dmax, const struct tm *tm) |
The asctime_s function converts the given calendar time tm to a textual representation of the following fixed 25-character form: "Www Mmm dd hh:mm:ss yyyy\n" , as with asctime. More... | |
EXPORT errno_t asctime_s | ( | char * | dest, |
rsize_t | dmax, | ||
const struct tm * | tm | ||
) |
The asctime_s
function converts the given calendar time tm
to a textual representation of the following fixed 25-character form: "Www Mmm dd hh:mm:ss yyyy\n"
, as with asctime.
The message is copied into user-provided dest
buffer, which is guaranteed to be null-terminated.
No more than dmax-1 bytes are written, the buffer is always null-terminated. Uses the re-entrant asctime_r()
if available.
[out] | dest | pointer to a user-provided buffer. |
[in] | dmax | restricted maximum length of dest |
[in] | tm | pointer to a tm object specifying the time to print |
EOK | on success |
ESNULLP | when dest or tm is a NULL pointer |
ESLEMAX | when dmax > RSIZE_MAX_STR or a tm member is too large |
ESLEMIN | when dmax < 26 or a tm member is too small |
ESNOSPC | when dmax is too small for the result buffer |
-1 | when asctime_r or asctime returned NULL |