Formats data under control of the format control string, using a variable argument list.
#include <stdio.h> int vsnprintf ( char *buf, size_t n, const char *format, va_list arg);
(OUT) Points to the buffer to which to write the result.
(IN) Specifies the maximum number of characters to write.
(IN) Points to the format control string. See Print Format Control Strings.
(IN) Specifies a variable argument list for conversion specifiers. The number of arguments in the list is determined by the format string.
If successful, returns the number of characters written into the buffer, not counting the null-terminating character. Otherwise, returns a negative value and sets errno to one of the following:
The vsnprintf function formats data under control of the format control string and writes the result to buf. The vsnprintf function is equivalent to vsprintf, with the addition of the n parameter to specify the maximum number of characters to write.