Fixed bug #1808529. One must use memmove() when copying overlapping blocks of memory (blush).

svn-id: r29161
This commit is contained in:
Nicola Mettifogo 2007-10-07 07:11:09 +00:00
parent 5ad7870775
commit 6351ed5379

View File

@ -302,7 +302,7 @@ void Inventory::removeItem(ItemName name) {
_numItems--;
if (_numItems != pos) {
memcpy(&_items[pos], &_items[pos+1], (_numItems - pos) * sizeof(InventoryItem));
memmove(&_items[pos], &_items[pos+1], (_numItems - pos) * sizeof(InventoryItem));
}
_items[_numItems]._id = 0;