mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2025-01-21 07:40:48 +00:00
x64 target bug: _findfirst handle truncation would lead to crashes on some machines
This commit is contained in:
parent
39ee0db5b7
commit
569247745b
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue