win: fix compilation with VS < 2012

PR-URL: https://github.com/libuv/libuv/pull/554
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
Ryan Johnston 2015-09-30 13:10:02 +13:00 committed by Saúl Ibarra Corretgé
parent 037a8ab29f
commit 764877fd9e

View File

@ -28,10 +28,11 @@
* on overflow...
*/
int snprintf(char* buf, size_t len, const char* fmt, ...) {
int n;
va_list ap;
va_start(ap, fmt);
int n = _vscprintf(fmt, ap);
n = _vscprintf(fmt, ap);
vsnprintf_s(buf, len, _TRUNCATE, fmt, ap);
va_end(ap);