patplex: Added URL unquoting functionality.
[ashd.git] / lib / utils.c
index 33e55c7..459afed 100644 (file)
@@ -307,6 +307,14 @@ char *base64decode(char *data, size_t *datalen)
     return(buf.b);
 }
 
+int hexdigit(char c)
+{
+    if((c >= '0') && (c <= '9'))      return(c - '0');
+    else if((c >= 'a') && (c <= 'f')) return(c - 'a' + 10);
+    else if((c >= 'A') && (c <= 'F')) return(c - 'A' + 10);
+    return(-1);
+}
+
 static int btheight(struct btree *tree)
 {
     if(tree == NULL)