Re: [PATCH v6 3/6] verify-tag: change variable name for readability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 17, 2016 at 6:26 PM,  <santiago@xxxxxxx> wrote:
> 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_length.

The commit message talks about 'payload_length', but the code names it
'payload_size'.

> Signed-off-by: Santiago Torres <santiago@xxxxxxx>
> ---
>  builtin/verify-tag.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c
> index 77f070a..010353c 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;
> +       int 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);
> --
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]