From de125e2ddca32d738cb2f75466dadc1658214bcc Mon Sep 17 00:00:00 2001 From: srowen Date: Thu, 14 Jul 2011 18:32:23 +0000 Subject: [PATCH] Issue 911 update Code 128 from Java to fix some issues git-svn-id: https://zxing.googlecode.com/svn/trunk@1858 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- cpp/core/src/zxing/oned/Code128Reader.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cpp/core/src/zxing/oned/Code128Reader.cpp b/cpp/core/src/zxing/oned/Code128Reader.cpp index 7b088219b..b76536a4f 100644 --- a/cpp/core/src/zxing/oned/Code128Reader.cpp +++ b/cpp/core/src/zxing/oned/Code128Reader.cpp @@ -376,11 +376,14 @@ namespace zxing { } break; case CODE_CODE_C: - // the code read in this case is the number encoded directly + tmpResultSStr.str(std::string()); + // the code read in this case is the number encoded directly if (code < 100) { - if (code < 10) - tmpResultSStr << '0'; - tmpResultSStr << code; + if (code < 10) { + tmpResultSStr << '0'; + } + tmpResultSStr << code; + tmpResultString.append(tmpResultSStr.str()); } else { if (code != CODE_STOP) { lastCharacterWasPrintable = false; @@ -438,9 +441,6 @@ namespace zxing { throw ReaderException(""); } - if (codeSet == CODE_CODE_C) - tmpResultString.append(tmpResultSStr.str()); - // Need to pull out the check digits from string int resultLength = tmpResultString.length(); // Only bother if the result had at least one character, and if the checksum digit happened to