fix 'a-x open all code' crash in linux system_set_file

This commit is contained in:
insofaras 2016-03-08 23:25:56 +00:00
parent 3561eb7849
commit df321f8d42
1 changed files with 4 additions and 2 deletions

View File

@ -319,9 +319,11 @@ Sys_Set_File_List_Sig(system_set_file_list){
File_Info *info_ptr;
i32 count, file_count, size, required_size;
terminate_with_null(&directory);
char* dir = (char*) alloca(directory.size + 1);
memcpy(dir, directory.str, directory.size);
dir[directory.size] = 0;
d = opendir(directory.str);
d = opendir(dir);
if (d){
count = 0;
file_count = 0;