Skip to content

Commit

Permalink
SSMprotocol2: Fix VIN validation
Browse files Browse the repository at this point in the history
Current sanity check fails on newer Outback and Diesel models, causing the software to display the VIN as "not registered yet".
  • Loading branch information
Comer352L committed May 26, 2010
1 parent 05f91fb commit 5cb1c20
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/SSMprotocol2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1871,13 +1871,11 @@ bool SSMprotocol2::validateVIN(char VIN[17])
unsigned char k = 0;
for (k=0; k<17; k++)
{
if ((VIN[k] < '\x30') || ((VIN[k] > '\x39') && (VIN[k] < '\x41')) || (VIN[k] > '\x5A'))
return false;
if ((k==5) || (k==8) || (k>10))
if ((VIN[k] < '\x30') || (VIN[k] > '\x39')) // 0-9
{
if (VIN[k] > '\x39')
if ((k > 10) || (VIN[k] < '\x41') || (VIN[k] > '\x5A')) // A-Z; NOTE: I,O,Q are not allowed
return false;
}
}
}
return true;
}
Expand Down

0 comments on commit 5cb1c20

Please sign in to comment.