Fix a hex detection bug (probably a typo)
GCC actually just warned be about this, which is how I found it. This is almost certianly a trivial typo: the array index are missing from one of the array accesses that checks to see if every character in a string is a valid hex character.
This commit is contained in:
parent
f59ff311ca
commit
57197f3045
1 changed files with 3 additions and 3 deletions
|
@ -492,9 +492,9 @@ int hex_only(char *str)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < strlen(str); i++) {
|
||||
if (((str[i] >= 'a') && str <= 'f') ||
|
||||
((str[i] >= 'A') && str <= 'F') ||
|
||||
((str[i] >= '0') && str <= '9')) {
|
||||
if (((str[i] >= 'a') && str[i] <= 'f') ||
|
||||
((str[i] >= 'A') && str[i] <= 'F') ||
|
||||
((str[i] >= '0') && str[i] <= '9')) {
|
||||
continue;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue