INtime SDK Help
vsnprintf, vsnprintf_s

vsprintf sends data to the memory pointed to by buffer.


#include <stdio.h>
#include <stdarg.h>

int vsnprintf(char *buffer, size_t size, const char *format, va_list ap);
int vsnprintf_s(char *buffer, rsize_t size, const char *format, va_list ap);

Parameters

buffer
Storage location for output.
size
The maximum number of characters to be stored in buffer.
format
Formatted string. This parameter has the same form and function as in printf.
ap
Pointer to list of arguments. This parameter has type va_list and points to a list of arguments that are converted and output according to the corresponding format specifications in format.

Remarks

These functions are similar to their counterparts snprintf and snprintf_s, but each accepts a pointer to a variable-argument list instead of additional arguments.

The vsnprintf_s function does some additional parameter validation. If buffer or format is NULL, or size is zero or greater than RSIZE_MAX then the function will return a negative number and set error to E_INVAL.

The vsnprintf_s function, unlike the vsprintf_s function, will truncate the result to fit in the array pointed to by buffer.

Return Values

The number of characters which would have been written, not counting the terminating null character, had size been sufficiently large.
Success.
A negative value if an output error occurs.
Failure.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/stdio.h stdio.h
stdarg.
clib.lib
See Also