Commit 5238954d authored by cutealien's avatar cutealien

Array index was used before limit check (found by cppcheck tool).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4948 dfc29bdd-3216-0410-991c-e03cc46cb475
parent b1a41dab
...@@ -584,7 +584,7 @@ public: ...@@ -584,7 +584,7 @@ public:
bool equalsn(const string<T,TAlloc>& other, u32 n) const bool equalsn(const string<T,TAlloc>& other, u32 n) const
{ {
u32 i; u32 i;
for(i=0; array[i] && other[i] && i < n; ++i) for(i=0; i < n && array[i] && other[i]; ++i)
if (array[i] != other[i]) if (array[i] != other[i])
return false; return false;
...@@ -603,7 +603,7 @@ public: ...@@ -603,7 +603,7 @@ public:
if (!str) if (!str)
return false; return false;
u32 i; u32 i;
for(i=0; array[i] && str[i] && i < n; ++i) for(i=0; i < n && array[i] && str[i]; ++i)
if (array[i] != str[i]) if (array[i] != str[i])
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment