From a7f7a284393dbadeb1aaa861677570b61b9658ae Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Fri, 16 Jan 2015 11:46:03 -0800 Subject: Fix a PDF417 encoding bug for 45 digits numeric data. This bug is fixed in https://github.com/zxing/zxing/commit/71d83953bdb2aa83a5c70e7e005adcbc523647dc R=tsepez@chromium.org Review URL: https://codereview.chromium.org/837663004 --- xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xfa/src/fxbarcode/pdf417') diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp index 8ee21ea97e..54bd0b6c6a 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp @@ -294,11 +294,11 @@ void CBC_PDF417HighLevelEncoder::encodeNumeric(CFX_WideString msg, FX_INT32 star { FX_INT32 idx = 0; BigInteger num900 = 900; - while (idx < count - 1) { + while (idx < count) { CFX_WideString tmp; FX_INT32 len = 44 < count - idx ? 44 : count - idx; CFX_ByteString part = ((FX_WCHAR)'1' + msg.Mid(startpos + idx, len)).UTF8Encode(); - BigInteger bigint = stringToBigInteger(FX_LPCSTR(part)); + BigInteger bigint = stringToBigInteger(part.c_str()); do { FX_INT32 c = (bigint % num900).toInt(); tmp += (FX_WCHAR)(c); -- cgit v1.2.3