diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2017-08-31 11:42:31 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-31 16:21:48 +0000 |
commit | 54b8137361f601148d266d779403ec0393113f39 (patch) | |
tree | 8c04fb0f0f37cafaac15e574e81c0d4376fc583c /fxbarcode | |
parent | fd42fc91f4fb4a2d85c8434e6ac2ec5d0ff6977b (diff) | |
download | pdfium-54b8137361f601148d266d779403ec0393113f39.tar.xz |
Fixing CBC_OnedEAN13Writer checksum.
Reverts a piece of
https://pdfium-review.googlesource.com/c/pdfium/+/12210
Bug: chromium:760857
Change-Id: I290ebb7b60a6508fc3e8fba6780c837d395c1c3b
Reviewed-on: https://pdfium-review.googlesource.com/12690
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fxbarcode')
-rw-r--r-- | fxbarcode/oned/BC_OnedEAN13Writer.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/fxbarcode/oned/BC_OnedEAN13Writer.cpp index 5dd10ab4fc..9a48c1ebae 100644 --- a/fxbarcode/oned/BC_OnedEAN13Writer.cpp +++ b/fxbarcode/oned/BC_OnedEAN13Writer.cpp @@ -80,11 +80,10 @@ int32_t CBC_OnedEAN13Writer::CalcChecksum(const CFX_ByteString& contents) { int32_t even = 0; FX_STRSIZE j = 1; for (FX_STRSIZE i = 0; i < contents.GetLength(); i++) { - FX_STRSIZE rev_i = (contents.GetLength() - 1) - 1; if (j % 2) { - odd += FXSYS_atoi(contents.Mid(i, rev_i).c_str()); + odd += FXSYS_atoi(contents.Mid(i, 1).c_str()); } else { - even += FXSYS_atoi(contents.Mid(i, rev_i).c_str()); + even += FXSYS_atoi(contents.Mid(i, 1).c_str()); } j++; } |