forked from rosebudai/OpenRCT2-Web
Allocate enough space for scenario name
This commit is contained in:
1 parent
7041d0c978
commit
8f48da411f
1 file changed
+1
-1
@@ -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