diff options
author | Darkvater <darkvater@openttd.org> | 2007-02-20 14:39:47 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2007-02-20 14:39:47 +0000 |
commit | b00692dff6528864c6c27e33e4aeb54e08f7c09f (patch) | |
tree | 6ed6701fd74348b1f471e6b350d5dfcddf504e6d /src | |
parent | 6d2548122124e93cf1e5493dade4d79c874809a0 (diff) | |
download | openttd-b00692dff6528864c6c27e33e4aeb54e08f7c09f.tar.xz |
(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.
Diffstat (limited to 'src')
-rw-r--r-- | src/win32.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/win32.cpp b/src/win32.cpp index 017d62a2c..c3198d645 100644 --- a/src/win32.cpp +++ b/src/win32.cpp @@ -664,7 +664,8 @@ DIR *opendir(const wchar_t *path) 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 || |