mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Fixed returning pointer from a local buffer
This commit is contained in:
@@ -216,13 +216,11 @@ void config_save()
|
||||
*/
|
||||
void config_init()
|
||||
{
|
||||
char path[MAX_PATH];
|
||||
char *path = osinterface_get_orct2_homefolder();
|
||||
FILE* fp;
|
||||
|
||||
memcpy(&gGeneral_config, &gGeneral_config_default, sizeof(general_configuration_t));
|
||||
|
||||
strncpy(path, osinterface_get_orct2_homefolder(), MAX_PATH);
|
||||
|
||||
if (strcmp(path, "") != 0){
|
||||
DWORD dwAttrib = GetFileAttributes(path);
|
||||
if (dwAttrib == INVALID_FILE_ATTRIBUTES || !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) { // folder does not exist
|
||||
@@ -245,6 +243,8 @@ void config_init()
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
free(path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user