diff --git a/expat/tests/acc_tests.c b/expat/tests/acc_tests.c index f193aa58..b58647a2 100644 --- a/expat/tests/acc_tests.c +++ b/expat/tests/acc_tests.c @@ -360,13 +360,16 @@ END_TEST START_TEST(test_helper_unsigned_char_to_printable) { // Smoke test unsigned char uc = 0; - for (; uc < (unsigned char)-1; uc++) { + for (;; uc++) { set_subtest("char %u", (unsigned)uc); const char *const printable = unsignedCharToPrintable(uc); if (printable == NULL) fail("unsignedCharToPrintable returned NULL"); else if (strlen(printable) < (size_t)1) fail("unsignedCharToPrintable returned empty string"); + if (uc == (unsigned char)-1) { + break; + } } // Two concrete samples