Allocate enough space for scenario name

This commit is contained in:
Michał Janiszewski authored and Duncan committed 2018-01-31 07:27:34 +00:00
1 parent 7041d0c978
commit 8f48da411f
1 file changed
+1 -1
+1 -1
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;