common: fix use of snprintf on Windows

Refs: https://github.com/libuv/libuv/pull/467
PR-URL: https://github.com/libuv/libuv/pull/487
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Saúl Ibarra Corretgé 2015-08-19 09:41:56 +02:00
parent 406961385d
commit 4c81d05112

View File

@ -141,7 +141,11 @@ static const char* uv__unknown_err_code(int err) {
char buf[32];
char* copy;
#ifndef _WIN32
snprintf(buf, sizeof(buf), "Unknown system error %d", err);
#else
_snprintf(buf, sizeof(buf), "Unknown system error %d", err);
#endif
copy = uv__strdup(buf);
return copy != NULL ? copy : "Unknown system error";