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>

Santiago Torres committed Apr 19, 2016 at 13:47 UTC 20972f54d3f17007904cacb829c1feefb84a68dd
1 file changed +6 -5
builtin/verify-tag.c
+6 -5
@@ -21,20 +21,21 @@ static const char * const verify_tag_usage[] = {
21 static int run_gpg_verify(const char *buf, unsigned long size, unsigned flags)
22 {
23 struct signature_check sigc;
24 - int len;
24 + size_t payload_size;
25 int ret;
26
27 memset(&sigc, 0, sizeof(sigc));
28
29 - len = parse_signature(buf, size);
29 + payload_size = parse_signature(buf, size);
30
31 - if (size == len) {
31 + if (size == payload_size) {
32 if (flags & GPG_VERIFY_VERBOSE)
33 - write_in_full(1, buf, len);
33 + write_in_full(1, buf, payload_size);
34 return error("no signature found");
35 }
36
37 - ret = check_signature(buf, len, buf + len, size - len, &sigc);
37 + ret = check_signature(buf, payload_size, buf + payload_size,
38 + size - payload_size, &sigc);
39 print_signature_buffer(&sigc, flags);
40
41 signature_check_clear(&sigc);