help-libtasn1
[Top][All Lists]
Advanced

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

Re: [PATCH] Use the smallest of the 2 lengths for the comparison


From: Nikos Mavrogiannopoulos
Subject: Re: [PATCH] Use the smallest of the 2 lengths for the comparison
Date: Mon, 28 Apr 2014 16:17:10 +0200

On Sun, Apr 27, 2014 at 11:17 PM, Kurt Roeckx <address@hidden> wrote:
> ---
>  lib/coding.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/lib/coding.c b/lib/coding.c
> index 15c87d3..34a204b 100644
> --- a/lib/coding.c
> +++ b/lib/coding.c
> @@ -925,7 +925,7 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, 
> asn1_node node)
>        counter = 0;
>        while (p2_vet)
>         {
> -         if ((p_vet->end - counter) > (p2_vet->end - p_vet->end))
> +         if ((p_vet->end - counter) < (p2_vet->end - p_vet->end))
>             max = p_vet->end - counter;
>           else
>             max = p2_vet->end - p_vet->end;

Hello,
 I've added the minmax gnulib module so that code like that could be
expressed as max = MAX(x, y) (or MIN). However, I think that storing
the minimum value in a variable called max is quite confusing. Is your
change for safety reasons or mandated by DER?

regards,
Nikos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]