summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-03-23 11:23:41 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-03-23 11:23:41 -0700
commit437ed4cea135fe544d646850faaa52937c650873 (patch)
treea27d6adbce68a86ad072eab6a6e9344eb7eb9c49
parentMerge branch 'rs/deflate-init-cleanup' into maint (diff)
parentuse isxdigit() for checking if a character is a hexadecimal digit (diff)
downloadtgif-437ed4cea135fe544d646850faaa52937c650873.tar.xz
Merge branch 'rs/use-isxdigit' into maint
Code cleanup. * rs/use-isxdigit: use isxdigit() for checking if a character is a hexadecimal digit
-rw-r--r--sha1_name.c2
-rw-r--r--transport.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 95f9f8fa1a..6d10f052b5 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -757,7 +757,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.
*/
diff --git a/transport.c b/transport.c
index 08bcd3a4eb..862f63f4e1 100644
--- a/transport.c
+++ b/transport.c
@@ -117,7 +117,7 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)
return;
}
- if (hexval(buffer[0]) > 0xf)
+ if (!isxdigit(buffer[0]))
continue;
len = strlen(buffer);
if (len && buffer[len - 1] == '\n')