Issue 165
[zxing.git] / cpp / core / src / qrcode / decoder / Version.cpp
index 39bbf7c..15bf80c 100644 (file)
@@ -118,6 +118,7 @@ namespace qrcode {
           FormatInformation::numBitsDiffering(versionBits, targetVersion);
         if (bitsDifference < bestDifference) {
           bestVersion = i + 7;
+          bestDifference = bitsDifference;
         }
       }
       // We can tolerate up to 3 bits of error since no two version info codewords will