From 57197f30458d23efaecf7a2ca117bcc1e1150574 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Mon, 2 Mar 2015 16:12:41 -0800 Subject: [PATCH] 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. --- eyefi-config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eyefi-config.c b/eyefi-config.c index 5a76efa..33e8296 100755 --- a/eyefi-config.c +++ b/eyefi-config.c @@ -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;