MCPcopy Index your code
hub / github.com/git/git / hex_to_bytes

Function hex_to_bytes

hex-ll.c:39–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37};
38
39int hex_to_bytes(unsigned char *binary, const char *hex, size_t len)
40{
41 for (; len; len--, hex += 2) {
42 unsigned int val = (hexval(hex[0]) << 4) | hexval(hex[1]);
43
44 if (val & ~0xff)
45 return -1;
46 *binary++ = val;
47 }
48 return 0;
49}

Callers 5

get_oid_hex_from_objpathFunction · 0.85
load_subtreeFunction · 0.85
loose_objs_statsFunction · 0.85
repack_local_linksFunction · 0.85

Calls 1

hexvalFunction · 0.85

Tested by

no test coverage detected