[10692] Fixed wrongly use %d for guids in DB queries.

This can affect correct result in cases big guid values
(out of range for possitive part of int32 range) at x86 platforms.

Some other cases addded in addition to original patch fixes
where %d wrongly/unsafe used for unsigned values.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
blueboy 2010-11-07 22:02:21 +03:00 committed by VladimirMangos
parent 10d3d3ce24
commit ee8cc71e38
16 changed files with 46 additions and 43 deletions

View file

@ -3559,7 +3559,7 @@ void ObjectMgr::LoadGroups()
{
sLog.outErrorDb("Incorrect entry in group_member table : no group with Id %d for member %s!",
groupId, memberGuid.GetString().c_str());
CharacterDatabase.PExecute("DELETE FROM group_member WHERE memberGuid = '%d'", memberGuidlow);
CharacterDatabase.PExecute("DELETE FROM group_member WHERE memberGuid = '%u'", memberGuidlow);
continue;
}
}
@ -3568,7 +3568,7 @@ void ObjectMgr::LoadGroups()
{
sLog.outErrorDb("Incorrect entry in group_member table : member %s cannot be added to group (Id: %u)!",
memberGuid.GetString().c_str(), groupId);
CharacterDatabase.PExecute("DELETE FROM group_member WHERE memberGuid = '%d'", memberGuidlow);
CharacterDatabase.PExecute("DELETE FROM group_member WHERE memberGuid = '%u'", memberGuidlow);
}
}while( result->NextRow() );
delete result;
@ -8659,8 +8659,8 @@ bool ObjectMgr::AddGameTele(GameTele& tele)
m_GameTeleMap[new_id] = tele;
return WorldDatabase.PExecuteLog("INSERT INTO game_tele (id,position_x,position_y,position_z,orientation,map,name) VALUES (%u,%f,%f,%f,%f,%d,'%s')",
new_id,tele.position_x,tele.position_y,tele.position_z,tele.orientation,tele.mapId,tele.name.c_str());
return WorldDatabase.PExecuteLog("INSERT INTO game_tele (id,position_x,position_y,position_z,orientation,map,name) VALUES (%u,%f,%f,%f,%f,%u,'%s')",
new_id, tele.position_x, tele.position_y, tele.position_z, tele.orientation, tele.mapId, tele.name.c_str());
}
bool ObjectMgr::DeleteGameTele(const std::string& name)