diff options
author | Bo Xu <bo_xu@foxitsoftware.com> | 2015-01-16 11:46:03 -0800 |
---|---|---|
committer | Bo Xu <bo_xu@foxitsoftware.com> | 2015-01-16 11:46:03 -0800 |
commit | a7f7a284393dbadeb1aaa861677570b61b9658ae (patch) | |
tree | a1df71abb36c0c691e45a120905e4cbacff2eb02 /xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp | |
parent | 4d62b6b16bf5df3911948bdb5dd336b365ec76e0 (diff) | |
download | pdfium-a7f7a284393dbadeb1aaa861677570b61b9658ae.tar.xz |
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
Diffstat (limited to 'xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp')
-rw-r--r-- | xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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);
|