diff --git a/icu4c/source/test/cintltst/utf8tst.c b/icu4c/source/test/cintltst/utf8tst.c index 2cb4bed335..9acbb0061f 100644 --- a/icu4c/source/test/cintltst/utf8tst.c +++ b/icu4c/source/test/cintltst/utf8tst.c @@ -341,19 +341,19 @@ static void TestNextPrevChar(){ 0xf4, 0x8f, 0xbf, 0xbe /* U+10fffe */ }; - UChar32 c; - int32_t i; + UChar32 ch; + int32_t idx; - for(i=0; i0;) { - U8_PREV(nonChars, 0, i, c); - if(!U_IS_UNICODE_NONCHAR(c)) { - log_err("U8_PREV(at %d) failed to read a non-character\n", i); + for(idx=(int32_t)sizeof(nonChars); idx>0;) { + U8_PREV(nonChars, 0, idx, ch); + if(!U_IS_UNICODE_NONCHAR(ch)) { + log_err("U8_PREV(at %d) failed to read a non-character\n", idx); } } }