summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Mangano2013-11-01 17:46:15 +0100
committerFrédéric Mangano2013-11-01 17:46:15 +0100
commitd3942ceac8dc77602f7ae399050b44e92c890933 (patch)
treee100431ba0edacac239c815310a6ca2fd2c2380e
parent44b013bd518ed70599dd428fb62acfde060a1286 (diff)
downloadlastos-d3942ceac8dc77602f7ae399050b44e92c890933.tar.gz
lastos-d3942ceac8dc77602f7ae399050b44e92c890933.zip
fix char to hex digit conversion
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index 35498e3..680b4db 100644
--- a/string.c
+++ b/string.c
@@ -88,8 +88,8 @@ char hexdigit(char c)
{
return
(c >= '0' && c <= '9') ? c - '0' :
- (c >= 'a' && c <= 'f') ? c - 'a' :
- (c >= 'A' && c <= 'F') ? c - 'A' : -1;
+ (c >= 'a' && c <= 'f') ? 10 + c - 'a' :
+ (c >= 'A' && c <= 'F') ? 10 + c - 'A' : -1;
}
uint32_t hextou32(char *src)