summaryrefslogtreecommitdiff
path: root/fxbarcode/oned/BC_OnedEAN13Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxbarcode/oned/BC_OnedEAN13Writer.cpp')
-rw-r--r--fxbarcode/oned/BC_OnedEAN13Writer.cpp5
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++;
}