From 569247745bbc7e85f0bfd0534291094ef58eae8a Mon Sep 17 00:00:00 2001 From: myT Date: Sun, 5 Mar 2017 20:20:59 +0100 Subject: [PATCH] x64 target bug: _findfirst handle truncation would lead to crashes on some machines --- code/win32/win_main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/win32/win_main.cpp b/code/win32/win_main.cpp index a6ee452..7b0875d 100644 --- a/code/win32/win_main.cpp +++ b/code/win32/win_main.cpp @@ -169,7 +169,7 @@ static void Sys_ListFilteredFiles( const char *basedir, const char *subdirs, con } struct _finddata_t findinfo; - int findhandle = _findfirst (search, &findinfo); + const intptr_t findhandle = _findfirst (search, &findinfo); if (findhandle == -1) { return; } @@ -208,7 +208,6 @@ char **Sys_ListFiles( const char *directory, const char *extension, const char * char **listCopy; char *list[MAX_FOUND_FILES]; struct _finddata_t findinfo; - int findhandle; int flag; int i; @@ -250,7 +249,7 @@ char **Sys_ListFiles( const char *directory, const char *extension, const char * // search nfiles = 0; - findhandle = _findfirst (search, &findinfo); + const intptr_t findhandle = _findfirst (search, &findinfo); if (findhandle == -1) { *numfiles = 0; return NULL;