Fix vsnprintf() emulation again.
commit3ec8d36fbf055f40bb5639221a260ae9a37d62e0
authorJohannes Sixt <johannes.sixt@telecom.at>
Wed, 11 Jun 2008 13:15:08 +0000 (11 15:15 +0200)
committerJohannes Sixt <johannes.sixt@telecom.at>
Wed, 11 Jun 2008 13:24:07 +0000 (11 15:24 +0200)
treec6b64a15f5c82e018e407277587cf00acfb8d7a6
parentb1013825f97b4f5a8097c25ee2a3cd4679f38f24
Fix vsnprintf() emulation again.

On Windows, if the native vsnprintf() fills the buffer, it does not add
the terminating NUL. The earlier commit f32edf6b tried to fix the
emulation, but the fix worked only if the formatted string fitted into
the buffer exactly. However, there are callers that do not try to resize
the buffer if it overflows, and in these cases the resulting string
remained without the trailing NUL. This patch adds the NUL in all cases.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
compat/snprintf.c