Skip to content
Browse files

Fix hex_value (broken by the last commit, thanks @bgrainger)

  • Loading branch information...
1 parent 0ce3215 commit 26fe61110639b1b67b907e964a96a188b5cf87a4 @udp committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 json.c
View
4 json.c
@@ -45,10 +45,10 @@ typedef unsigned short json_uchar;
static unsigned char hex_value (json_char c)
{
if (c >= 'A' && c <= 'Z')
- return c - 'A';
+ return (c - 'A') + 10;
if (c >= 'a' && c <= 'z')
- return c - 'a';
+ return (c - 'a') + 10;
if (c >= '0' && c <= '9')
return c - '0';

2 comments on commit 26fe611

@bgrainger

Should restrict valid input to [0-9A-Fa-f].

@udp
Owner

And committed again. If it's any consolation, I've been awake for about 20 hours :p

Thanks a bunch

Please sign in to comment.
Something went wrong with that request. Please try again.