From 6f75d45b2412c646b74300f360361b319689e554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Mon, 9 Mar 2015 23:46:54 +0100 Subject: use isxdigit() for checking if a character is a hexadecimal digit Use the standard function isxdigit() to make the intent clearer and avoid using magic constants. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- sha1_name.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sha1_name.c') diff --git a/sha1_name.c b/sha1_name.c index c2c938c4e..dc85aafec 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -749,7 +749,7 @@ static int get_describe_name(const char *name, int len, unsigned char *sha1) for (cp = name + len - 1; name + 2 <= cp; cp--) { char ch = *cp; - if (hexval(ch) & ~0377) { + if (!isxdigit(ch)) { /* We must be looking at g in "SOMETHING-g" * for it to be describe output. */ -- cgit v1.2.1