]> granicus.if.org Git - icu/commitdiff
ICU-21801 Fix array comparison warning in uspoof_impl.cpp
authorShane F. Carr <shane@unicode.org>
Tue, 8 Mar 2022 18:45:21 +0000 (18:45 +0000)
committerShane F. Carr <shane@unicode.org>
Tue, 8 Mar 2022 23:21:53 +0000 (15:21 -0800)
See #2015

icu4c/source/i18n/uspoof_impl.cpp

index b283d813210d9d9c237c24e631e8ea8097413b94..f96826f86ccc1294ed8ae2ffea85b93615004f19 100644 (file)
@@ -945,7 +945,7 @@ uspoof_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *ou
     uint32_t magic = ds->readUInt32(spoofDH->fMagic);
     ds->writeUInt32((uint32_t *)&outputDH->fMagic, magic);
 
-    if (outputDH->fFormatVersion != spoofDH->fFormatVersion) {
+    if (inBytes != outBytes) {
         uprv_memcpy(outputDH->fFormatVersion, spoofDH->fFormatVersion, sizeof(spoofDH->fFormatVersion));
     }
     // swap starting at fLength