aboutsummaryrefslogtreecommitdiffstats
path: root/shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/shared.c b/shared.c
index 7def51a..e4595fa 100644
--- a/shared.c
+++ b/shared.c
@@ -113,3 +113,16 @@ void *cgit_free_commitinfo(struct commitinfo *info)
113 free(info); 113 free(info);
114 return NULL; 114 return NULL;
115} 115}
116
117int hextoint(char c)
118{
119 if (c >= 'a' && c <= 'f')
120 return 10 + c - 'a';
121 else if (c >= 'A' && c <= 'F')
122 return 10 + c - 'A';
123 else if (c >= '0' && c <= '9')
124 return c - '0';
125 else
126 return -1;
127}
128