mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
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:
parent
a9754fb978
commit
327df794ae
|
@ -429,6 +429,11 @@ public final class Code128Reader extends OneDReader {
|
||||||
|
|
||||||
// Need to pull out the check digits from string
|
// Need to pull out the check digits from string
|
||||||
int resultLength = result.length();
|
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
|
// 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.
|
// be a printable character. If it was just interpreted as a control code, nothing to remove.
|
||||||
if (resultLength > 0 && lastCharacterWasPrintable) {
|
if (resultLength > 0 && lastCharacterWasPrintable) {
|
||||||
|
|
Loading…
Reference in a new issue