Skip to content
This repository was archived by the owner on May 4, 2018. It is now read-only.

Commit fe3a11e

Browse files
Brent Cookbnoordhuis
authored andcommitted
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
1 parent f3f23b2 commit fe3a11e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/win/fs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,10 +715,10 @@ void fs__readdir(uv_fs_t* req) {
715715
uv_fatal_error(ERROR_OUTOFMEMORY, "malloc");
716716
}
717717

718-
#ifdef _MSC_VER
719-
swprintf(path2, len + 3, fmt, pathw);
720-
#else
718+
#ifdef _CRT_NON_CONFORMING_SWPRINTFS
721719
swprintf(path2, fmt, pathw);
720+
#else
721+
swprintf(path2, len + 3, fmt, pathw);
722722
#endif
723723
dir = FindFirstFileW(path2, &ent);
724724
free(path2);

0 commit comments

Comments
 (0)