the buffer to hold the output.
the maximum number of bytes to produce (including the terminating nul character).
a standard printf() format string, but notice [string precision pitfalls][string-precision]
the list of arguments to insert in the output.
the number of bytes which would be produced if the buffer was large enough.
A safer form of the standard vsprintf() function. The output is guaranteed to not exceed @n characters (including the terminating nul character), so it is easy to ensure that a buffer overflow cannot occur.
See also g_strdup_vprintf().
In versions of GLib prior to 1.2.3, this function may return -1 if the output was truncated, and the truncated string may not be nul-terminated. In versions prior to 1.3.12, this function returns the length of the output string.
The return value of g_vsnprintf() conforms to the vsnprintf() function as standardized in ISO C99. Note that this is different from traditional vsnprintf(), which returns the length of the output string.
The format string may contain positional parameters, as specified in the Single Unix Specification.