mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
Don't cast address to scalar (this is fishy)
This commit is contained in:
parent
d5135f997f
commit
da69f7faa9
@ -501,7 +501,8 @@ MxAtomId* LegoOmni::GetScriptAtom(MxU32 p_index)
|
||||
MxS32 LegoOmni::GetScriptIndex(const char* p_key)
|
||||
{
|
||||
for (MxS32 i = 0; i < 19; i++) {
|
||||
if ((MxS32) &m_scripts[i] != -4 && !strcmpi(m_scripts[i].GetKey(), p_key)) {
|
||||
// FIXME: this looks very fishy. Is this guarding against out-of-bounds access?
|
||||
if ((MxS32*) (&m_scripts[i]) != (MxS32*) -4 && !strcmpi(m_scripts[i].GetKey(), p_key)) {
|
||||
return m_scripts[i].GetIndex();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user