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:
Palmer Dabbelt 2015-03-02 16:12:41 -08:00 committed by Dave Hansen
parent f59ff311ca
commit 57197f3045

View file

@ -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;