# HG changeset patch # User Darkvater # Date 1171982387 0 # Node ID cedfb953efbf3162ee798695c4bfe2d1010fce4a # Parent 636539830f0ec5413be79c04fa552e6c5db40ce7 (svn r8824) -Fix (r8821): don't use MSVC2005 runtime library-only _snwprintf_s function, but use 'insecure/deprecated' version and zero-terminate string ourselves. Thanks for testing glx. diff --git a/src/win32.cpp b/src/win32.cpp --- a/src/win32.cpp +++ b/src/win32.cpp @@ -664,7 +664,8 @@ if (d != NULL) { wchar_t search_path[MAX_PATH]; /* build search path for FindFirstFile */ - _snwprintf_s(search_path, lengthof(search_path), L"%s\\*", path); + _snwprintf(search_path, lengthof(search_path), L"%s\\*", path); + *lastof(search_path) = '\0'; d->hFind = FindFirstFileW(search_path, &d->fd); if (d->hFind != INVALID_HANDLE_VALUE ||