diff mbox

[2/2] iw: UNSPECIFIED_CHAR_IN_COND : Fix

Message ID 1448529080-710-1-git-send-email-rahul.jain@samsung.com (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show

Commit Message

Rahul Jain Nov. 26, 2015, 9:11 a.m. UTC
From: Amit Khatri <amit.khatri@samsung.com>

Signed-off-by: Amit Khatri <amit.khatri@samsung.com>
Signed-off-by: Rahul Jain <rahul.jain@samsung.com>
---
 util.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Johannes Berg Nov. 26, 2015, 9:36 a.m. UTC | #1
Err, the other patch I can kinda understand - but this one? What kind
of static checker is giving that warning, and what does it really mean?
please describe in the commit log... actually I'm not sure why I should
apply this at all even, if there's a problem just make the function
prototype "unsigned char"?

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/util.c b/util.c
index 8fd14bd..7edc830 100644
--- a/util.c
+++ b/util.c
@@ -330,11 +330,13 @@  void print_ssid_escaped(const uint8_t len, const uint8_t *data)
 
 static int hex2num(char digit)
 {
+	unsigned char temp;
+	temp = digit;
 	if (!isxdigit(digit))
 		return -1;
 	if (isdigit(digit))
 		return digit - '0';
-	return tolower(digit) - 'a' + 10;
+	return tolower(temp) - 'a' + 10;
 }
 
 static int hex2byte(char *hex)