Change memcpy for safestrncpy for char * (#7629)

This commit is contained in:
Vincent Stumpf
2023-03-06 09:53:23 -08:00
committed by GitHub
parent 6a0b7afd88
commit 1b1164f91d
4 changed files with 18 additions and 18 deletions

View File

@@ -14496,7 +14496,7 @@ BUILDIN_FUNC(getitemname)
char* item_name = (char *)aMalloc( ITEM_NAME_LENGTH * sizeof( char ) );
memcpy(item_name, i_data->ename.c_str(), ITEM_NAME_LENGTH);
safestrncpy(item_name, i_data->ename.c_str(), ITEM_NAME_LENGTH);
script_pushstr(st,item_name);
return SCRIPT_CMD_SUCCESS;