MCPcopy Create free account
hub / github.com/git/git / hex2chr

Function hex2chr

hex-ll.h:14–18  ·  view source on GitHub ↗

* Convert two consecutive hexadecimal digits into a char. Return a * negative value on error. Don't run over the end of short strings. */

Source from the content-addressed store, hash-verified

12 * negative value on error. Don't run over the end of short strings.
13 */
14static inline int hex2chr(const char *s)
15{
16 unsigned int val = hexval(s[0]);
17 return (val & ~0xf) ? val : (val << 4) | hexval(s[1]);
18}
19
20/*
21 * Read `len` pairs of hexadecimal digits from `hex` and write the

Callers 7

get_hash_hex_algopFunction · 0.85
append_literalFunction · 0.85
strbuf_expand_literalFunction · 0.85
decode_q_segmentFunction · 0.85
url_decode_internalFunction · 0.85
decode_q_segmentFunction · 0.85

Calls 1

hexvalFunction · 0.85

Tested by

no test coverage detected