diff --git a/icu4c/source/io/ufmt_cmn.cpp b/icu4c/source/io/ufmt_cmn.cpp index 42e8e3e5466..2b1a76fc8a2 100644 --- a/icu4c/source/io/ufmt_cmn.cpp +++ b/icu4c/source/io/ufmt_cmn.cpp @@ -187,7 +187,7 @@ ufmt_utop(const UChar *buffer, } /* iterate through buffer, stop when you hit the end */ - while(ufmt_isdigit(buffer[count], 16) && count < *len) { + while(count < *len && ufmt_isdigit(buffer[count], 16)) { /* increment the count consumed */ ++count; }