Seems like vsnprintf _always_ returns the number of bytes actually
written, also if the provided buffer was too small, in which case the
number of bytes that would have been written if a large enough buffer
would have been available should be returned.
Anyone else seen this ? Did I miss something ?
I believe the behaviour you want is new in C99 (certainly new as far as
the eCos C library is concerned :-)). Or rather, C99 added the *nprintf
functions (vsnprintf and snprintf). This was to reflect existing practice,
like we have in eCos, except that they defined the return value
differently from that existing practice.