diff --git a/src/unity.c b/src/unity.c index 58e93db8bd393400e639e4adeae0a3dc79a9a7cf..a43e33e1a3ed555f7ff595bee84f2715d8541082 100644 --- a/src/unity.c +++ b/src/unity.c @@ -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]) {