We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9842b92 commit b23abf4Copy full SHA for b23abf4
src/operators/verify_cc.cc
@@ -59,7 +59,6 @@ int VerifyCC::luhnVerify(const char *ccnumber, int len) {
59
int sum[2] = { 0, 0 };
60
int odd = 0;
61
int digits = 0;
62
- int i;
63
64
/* Weighted lookup table which is just a precalculated (i = index):
65
* i*2 + (( (i*2) > 9 ) ? -9 : 0)
@@ -71,7 +70,7 @@ int VerifyCC::luhnVerify(const char *ccnumber, int len) {
71
70
/* Add up only digits (weighted digits via lookup table)
72
* for both odd and even CC numbers to avoid 2 passes.
73
*/
74
- for (i = 0; i < len; i++) {
+ for (int i = 0;i < len;i++) {
75
if (ccnumber[i] >= (0 + 48) && ccnumber[i] <= (9 + 48)) {
76
sum[0] += (!odd ? wtable[ccnumber[i] - '0'] : (ccnumber[i] - '0'));
77
sum[1] += (odd ? wtable[ccnumber[i] - '0'] : (ccnumber[i] - '0'));
0 commit comments