Change memcpy for safestrncpy for char * (#7629)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user