1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 08:25:58 +01:00

check 'i' limit before using it as an array index.

fix cppcheck "Array index 'i' is used before limits check."
This commit is contained in:
Jeremy Hannon
2016-09-26 16:01:03 -05:00
parent 3581ebb69e
commit 148b4977cf

View File

@@ -1004,7 +1004,7 @@ void UnityAssertEqualStringLen(const char* expected,
/* if both pointers not null compare the strings */
if (expected && actual)
{
for (i = 0; (expected[i] || actual[i]) && i < length; i++)
for (i = 0; (i < length) && (expected[i] || actual[i]); i++)
{
if (expected[i] != actual[i])
{