summaryrefslogtreecommitdiff
path: root/builtin/verify-tag.c
diff options
context:
space:
mode:
authorSantiago Torres <santiago@nyu.edu>2016-04-19 17:47:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-04-19 19:52:15 (GMT)
commit20972f54d3f17007904cacb829c1feefb84a68dd (patch)
tree3833802b92b9e61114450bf4ef3a93d231066d25 /builtin/verify-tag.c
parent3e1e7454cc6737ceff0311451eba7a698da9d8c9 (diff)
downloadgit-20972f54d3f17007904cacb829c1feefb84a68dd.zip
git-20972f54d3f17007904cacb829c1feefb84a68dd.tar.gz
git-20972f54d3f17007904cacb829c1feefb84a68dd.tar.bz2
verify-tag: update variable name and type
The run_gpg_verify() function has two variables, size and len. This may come off as confusing when reading the code. Clarify which one pertains to the length of the tag headers by renaming len to payload_size. Additionally, change the type of payload_size to size_t to match the return type of parse_signature. Signed-off-by: Santiago Torres <santiago@nyu.edu> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/verify-tag.c')
-rw-r--r--builtin/verify-tag.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c
index 77f070a..fa26e40 100644
--- a/builtin/verify-tag.c
+++ b/builtin/verify-tag.c
@@ -21,20 +21,21 @@ static const char * const verify_tag_usage[] = {
static int run_gpg_verify(const char *buf, unsigned long size, unsigned flags)
{
struct signature_check sigc;
- int len;
+ size_t payload_size;
int ret;
memset(&sigc, 0, sizeof(sigc));
- len = parse_signature(buf, size);
+ payload_size = parse_signature(buf, size);
- if (size == len) {
+ if (size == payload_size) {
if (flags & GPG_VERIFY_VERBOSE)
- write_in_full(1, buf, len);
+ write_in_full(1, buf, payload_size);
return error("no signature found");
}
- ret = check_signature(buf, len, buf + len, size - len, &sigc);
+ ret = check_signature(buf, payload_size, buf + payload_size,
+ size - payload_size, &sigc);
print_signature_buffer(&sigc, flags);
signature_check_clear(&sigc);