static inline int vlc_vsnprintf (char *str, size_t size, const char *format, va_list ap)
{
char *fmt = vlc_fix_format_string (format);
- int ret = vsnprintf (str, size, fmt ? fmt : format, ap);
+ /* traditionally, MSVCRT has provided vsnprintf as _vsnprintf;
+ * to 'aid' portability/standards compliance, mingw provides a
+ * static version of vsnprintf that is buggy. Be sure to use
+ * MSVCRT version, at least it behaves as expected */
+ int ret = _vsnprintf (str, size, fmt ? fmt : format, ap);
free (fmt);
return ret;
}
va_list ap;
int ret;
va_start (ap, format);
- ret = vprintf (format, ap);
+ ret = vlc_vprintf (format, ap);
va_end (ap);
return ret;
}
va_list ap;
int ret;
va_start (ap, format);
- ret = vfprintf (stream, format, ap);
+ ret = vlc_vfprintf (stream, format, ap);
va_end (ap);
return ret;
}
va_list ap;
int ret;
va_start (ap, format);
- ret = vsprintf (str, format, ap);
+ ret = vlc_vsprintf (str, format, ap);
va_end (ap);
return ret;
}
va_list ap;
int ret;
va_start (ap, format);
- ret = vsnprintf (str, size, format, ap);
+ ret = vlc_vsnprintf (str, size, format, ap);
va_end (ap);
return ret;
}
+/* win32: snprintf must always be vlc_snprintf or _snprintf,
+ * see comment in vlc_vsnprintf */
# define snprintf vlc_snprintf
/* Make sure we don't use flawed vasprintf or asprintf either */