5.15.6. vsnprintf()

The vsnprintf() function works almost exactly like the ISO vsprintf() function, except that the caller can specify the maximum size of the buffer. The return value is the length of the complete formatted string that would have been written if the buffer were big enough. Therefore, the string written into the buffer is complete only if the return value is at least zero and at most n-1.

The bufsize parameter specifies the number of characters of buffer that the function can write into, including the terminating null.

<stdio.h> is an ISO header file, but the function is prohibited by the ISO C library standard. It is, therefore, not available if you use the compiler with the --strict option.

Syntax

int vsnprintf(char *buffer, size_t bufsize, const  char *format, va_list ap);

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0205F
Non-Confidential