Re: Silly coding in pgcrypto - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Silly coding in pgcrypto
Date
Msg-id 20141102213434.GA540883@tornado.leadboat.com
Whole thread Raw
In response to Silly coding in pgcrypto  (Marko Tiikkaja <marko@joh.to>)
Responses Re: Silly coding in pgcrypto  (Tomas Vondra <tv@fuzzy.cz>)
Re: Silly coding in pgcrypto  (Marko Tiikkaja <marko@joh.to>)
List pgsql-hackers
On Sun, Nov 02, 2014 at 05:10:25AM +0100, Marko Tiikkaja wrote:
> *** a/contrib/pgcrypto/pgp-decrypt.c
> --- b/contrib/pgcrypto/pgp-decrypt.c
> ***************
> *** 1069,1075 **** pgp_skip_packet(PullFilter *pkt)
>   
>       while (res > 0)
>           res = pullf_read(pkt, 32 * 1024, &tmp);
> !     return res < 0 ? res : 0;
>   }
>   
>   /*
> --- 1069,1075 ----
>   
>       while (res > 0)
>           res = pullf_read(pkt, 32 * 1024, &tmp);
> !     return res;

Why is the old code silly and the new code correct?



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Let's drop two obsolete features which are bear-traps for novices
Next
From: Tomas Vondra
Date:
Subject: Re: Silly coding in pgcrypto