]> git.sesse.net Git - vlc/commitdiff
vasprintf: stop HEAP exceptions
authorKen Self <kenself@optusnet.com.au>
Sun, 4 Jan 2009 22:54:56 +0000 (09:54 +1100)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 7 Jan 2009 19:36:38 +0000 (21:36 +0200)
On Win32, vsnprintf() and vsprintf() are formatting certain things
differently, e.g. "%p". We need to use the same implementation
throughout our vasprintf() replacement.

Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com>
include/vlc_fixups.h

index b88a900b2383c353067fc814ccbae9b1554f8ab7..726bb9e2e02a2ecb335df69bbbbc68dd43855272 100644 (file)
@@ -50,7 +50,7 @@ static inline int vasprintf (char **strp, const char *fmt, va_list ap)
     if (res == NULL)
         return -1;
     *strp = res;
-    return vsprintf (res, fmt, ap);
+    return vsnprintf (res, len, fmt, ap);
 #else
     /* HACK: vsnprintf in the WinCE API behaves like
      * the one in glibc 2.0 and doesn't return the number of characters