File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ int VerifyCC::luhnVerify(const char *ccnumber, int len) {
5959 int sum[2 ] = { 0 , 0 };
6060 int odd = 0 ;
6161 int digits = 0 ;
62- int i;
6362
6463 /* Weighted lookup table which is just a precalculated (i = index):
6564 * i*2 + (( (i*2) > 9 ) ? -9 : 0)
@@ -71,7 +70,7 @@ int VerifyCC::luhnVerify(const char *ccnumber, int len) {
7170 /* Add up only digits (weighted digits via lookup table)
7271 * for both odd and even CC numbers to avoid 2 passes.
7372 */
74- for (i = 0 ; i < len; i++) {
73+ for (int i = 0 ;i < len;i++) {
7574 if (ccnumber[i] >= (0 + 48 ) && ccnumber[i] <= (9 + 48 )) {
7675 sum[0 ] += (!odd ? wtable[ccnumber[i] - ' 0' ] : (ccnumber[i] - ' 0' ));
7776 sum[1 ] += (odd ? wtable[ccnumber[i] - ' 0' ] : (ccnumber[i] - ' 0' ));
You can’t perform that action at this time.
0 commit comments