From 905919e63b7b4357ca75ef5e8bfeca7485428dc9 Mon Sep 17 00:00:00 2001 From: schu Date: Tue, 14 Feb 2012 20:44:22 +0100 Subject: [PATCH] util: add git__ishex git__ishex allows to check if a string is a hexadecimal representation. Signed-off-by: schu --- src/util.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/util.h b/src/util.h index 0eff90669..f77c91dfd 100644 --- a/src/util.h +++ b/src/util.h @@ -169,4 +169,13 @@ GIT_INLINE(int) git__fromhex(char h) return from_hex[(unsigned char) h]; } +GIT_INLINE(int) git__ishex(const char *str) +{ + unsigned i; + for (i=0; i