summaryrefslogtreecommitdiff
path: root/notes.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-11-09 05:31:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-09 05:31:27 (GMT)
commitbde13700105a1c945819578ce8d5c0627d52c741 (patch)
treef099ae14f511cb3461a0f7e8361bb85b4679506e /notes.c
parentb169d187682ed3f928df7806b00f3a62b83edfef (diff)
parent62a24c8923274b0ef941b2e7bc6efdb2fd52e6bf (diff)
downloadgit-bde13700105a1c945819578ce8d5c0627d52c741.zip
git-bde13700105a1c945819578ce8d5c0627d52c741.tar.gz
git-bde13700105a1c945819578ce8d5c0627d52c741.tar.bz2
Merge branch 'rs/hex-to-bytes-cleanup'
Code cleanup. * rs/hex-to-bytes-cleanup: sha1_file: use hex_to_bytes() http-push: use hex_to_bytes() notes: move hex_to_bytes() to hex.c and export it
Diffstat (limited to 'notes.c')
-rw-r--r--notes.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/notes.c b/notes.c
index d273822..c7f21fa 100644
--- a/notes.c
+++ b/notes.c
@@ -334,23 +334,6 @@ static void note_tree_free(struct int_node *tree)
}
}
-/*
- * Read `len` pairs of hexadecimal digits from `hex` and write the
- * values to `binary` as `len` bytes. Return 0 on success, or -1 if
- * the input does not consist of hex digits).
- */
-static int hex_to_bytes(unsigned char *binary, const char *hex, size_t len)
-{
- for (; len; len--, hex += 2) {
- unsigned int val = (hexval(hex[0]) << 4) | hexval(hex[1]);
-
- if (val & ~0xff)
- return -1;
- *binary++ = val;
- }
- return 0;
-}
-
static int non_note_cmp(const struct non_note *a, const struct non_note *b)
{
return strcmp(a->path, b->path);