7.19.6.13 The vsprintf function
Synopsis
#include <stdarg.h>
#include <stdio.h>
int vsprintf(char * restrict s,
const char * restrict format,
va_list arg);
Description
The vsprintf function is equivalent to sprintf, with the variable argument list replaced by arg, which shall have been initialized by the va_start macro (and possibly subsequent va_arg calls). The vsprintf function does not invoke the va_end macro.[1] If copying takes place between objects that overlap, the behavior is undefined.
Returns
The vsprintf function returns the number of characters written in the array, not counting the terminating null character, or a negative value if an encoding error occurred.
Footnotes