diff --git a/icu4c/source/test/cintltst/callcoll.c b/icu4c/source/test/cintltst/callcoll.c index 82000d58a90..f57dc605a64 100644 --- a/icu4c/source/test/cintltst/callcoll.c +++ b/icu4c/source/test/cintltst/callcoll.c @@ -859,10 +859,8 @@ static void TestJB581(void) /* Now, do the same comparison with keys */ sourceKeyOut = ucol_getSortKey(myCollator, source, -1, sourceKeyArray, 100); targetKeyOut = ucol_getSortKey(myCollator, target, -1, targetKeyArray, 100); - result = 0; bufferLen = ((targetKeyOut > 100) ? 100 : targetKeyOut); - result = memcmp(sourceKeyArray, targetKeyArray, bufferLen); - if (result != 0) + if (memcmp(sourceKeyArray, targetKeyArray, bufferLen) != 0) { log_err("Comparing two strings with sort keys in C failed.\n"); } diff --git a/icu4c/source/tools/genrb/parse.c b/icu4c/source/tools/genrb/parse.c index 28d72ba1081..b4aa2caf0e1 100644 --- a/icu4c/source/tools/genrb/parse.c +++ b/icu4c/source/tools/genrb/parse.c @@ -1650,7 +1650,8 @@ parseResourceType(UErrorCode *status) *status = U_ZERO_ERROR; /* Search for normal types */ - for (result = RT_UNKNOWN+1; result < RT_RESERVED; result++) { + result=RT_UNKNOWN; + while (++result < RT_RESERVED) { if (u_strcmp(tokenValue->fChars, gResourceTypes[result].nameUChars) == 0) { break; }