diff --git a/src/unity.c b/src/unity.c index 177af0f4348e0a3b43f9cfd6c7f488049ea7561f..209efe72a5183c077dca1353cc0167a1ea1f17bc 100644 --- a/src/unity.c +++ b/src/unity.c @@ -556,7 +556,7 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected, if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) UNITY_FAIL_AND_BAIL; - while (elements--) + while ((elements > 0) && elements--) { UNITY_INT expect_val; UNITY_INT actual_val;