1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00

Allocate enough space for scenario name

This commit is contained in:
Michał Janiszewski
2018-01-30 15:51:29 +01:00
committed by Duncan
parent 7041d0c978
commit 8f48da411f

View File

@@ -768,7 +768,7 @@ void update_park_fences_around_tile(sint32 x, sint32 y)
void park_set_name(const char *name)
{
// Required else the pointer arithmetic in the game commands below could cause an access violation
char* newName = (char *)malloc(USER_STRING_MAX_LENGTH + 1);
char* newName = (char *)malloc(USER_STRING_MAX_LENGTH + 5);
strncpy(newName, name, USER_STRING_MAX_LENGTH);
gGameCommandErrorTitle = STR_CANT_RENAME_PARK;