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:
committed by
Duncan
parent
7041d0c978
commit
8f48da411f
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user