[FFmpeg-devel] [PATCH] [RFC] avoid _vscnprintf since it exists only since WinXP.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jul 22 21:05:54 CEST 2012

The MSDN documentation is wrong, this function does not exist
on e.g. Win2k.
By my reading of the only case where it is used, this hack should work
almost as well, though it is ugly and comes with a risk of breaking
in the future.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
 libavutil/bprint.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/bprint.c b/libavutil/bprint.c
index 6e59f6b..8b4996e 100644
--- a/libavutil/bprint.c
+++ b/libavutil/bprint.c
@@ -37,7 +37,7 @@ static int vsnprintf_fixed(char *s, size_t n, const char *format, va_list va)
     r = vsnprintf(s, n, format, va2);
     if (r == -1)
-        r = _vscprintf(format, va);
+        r = 2*n;
     return r;

More information about the ffmpeg-devel mailing list