From 4c81d05112782094e80ee01acabebfaca3f96d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 19 Aug 2015 09:41:56 +0200 Subject: [PATCH] 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 --- src/uv-common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/uv-common.c b/src/uv-common.c index 8ce3d1f4..675a776b 100644 --- a/src/uv-common.c +++ b/src/uv-common.c @@ -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";