]> gitweb.ps.run Git - ps-cgit/blobdiff - shared.c
Use TTL-settings even in nocache mode
[ps-cgit] / shared.c
index 7def51a997beb49f5b302477beba9aee80aebfb2..e4595fabe0cd2f1650fa1566adfb67c1568b60e3 100644 (file)
--- a/shared.c
+++ b/shared.c
@@ -113,3 +113,16 @@ void *cgit_free_commitinfo(struct commitinfo *info)
        free(info);
        return NULL;
 }
+
+int hextoint(char c)
+{
+       if (c >= 'a' && c <= 'f')
+               return 10 + c - 'a';
+       else if (c >= 'A' && c <= 'F')
+               return 10 + c - 'A';
+       else if (c >= '0' && c <= '9')
+               return c - '0';
+       else
+               return -1;
+}
+