1
0
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:
atmaxinger
2014-05-26 09:27:54 +02:00
parent 07128831fb
commit 35ff9a510d
3 changed files with 10 additions and 5 deletions

View File

@@ -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);
}
/**