Slightly reverse Code 128 change: don't allow length 0 code

git-svn-id: https://zxing.googlecode.com/svn/trunk@2093 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2011-12-17 16:47:15 +00:00
parent a9754fb978
commit 327df794ae

View file

@ -429,6 +429,11 @@ public final class Code128Reader extends OneDReader {
// Need to pull out the check digits from string
int resultLength = result.length();
if (resultLength == 0) {
// false positive
throw ChecksumException.getChecksumInstance();
}
// Only bother if the result had at least one character, and if the checksum digit happened to
// be a printable character. If it was just interpreted as a control code, nothing to remove.
if (resultLength > 0 && lastCharacterWasPrintable) {