From fe3a11e09f8bb004c4a2756e01e7ed2c837291f2 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sat, 31 Aug 2013 04:52:31 -0500 Subject: [PATCH] windows: check for nonconforming swprintf arguments Newer versions of mingw do include the correct API for swprintf. Check for _CRT_NON_CONFORMING_SWPRINTFS as specified in the swprintf documentation: http://msdn.microsoft.com/en-us/library/ybk95axf(v=vs.90).aspx --- src/win/fs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win/fs.c b/src/win/fs.c index 879f1f1d..0475f433 100644 --- a/src/win/fs.c +++ b/src/win/fs.c @@ -715,10 +715,10 @@ void fs__readdir(uv_fs_t* req) { uv_fatal_error(ERROR_OUTOFMEMORY, "malloc"); } -#ifdef _MSC_VER - swprintf(path2, len + 3, fmt, pathw); -#else +#ifdef _CRT_NON_CONFORMING_SWPRINTFS swprintf(path2, fmt, pathw); +#else + swprintf(path2, len + 3, fmt, pathw); #endif dir = FindFirstFileW(path2, &ent); free(path2);