(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.
authorDarkvater
Tue, 20 Feb 2007 14:39:47 +0000
changeset 6415 c802d76a67fd
parent 6414 3a4b44cf00b1
child 6416 be4399248c60
(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.
src/win32.cpp
--- a/src/win32.cpp	Tue Feb 20 09:46:10 2007 +0000
+++ b/src/win32.cpp	Tue Feb 20 14:39:47 2007 +0000
@@ -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 ||