[pacman-dev] [PATCH] alpm/handle.c: ensure handle is not NULL before proceeding

Rémy Oudompheng remyoudompheng at gmail.com
Mon Mar 28 15:47:35 EDT 2011


On Mon 28 March 2011 at 21:28 +0200, Xavier Chantry wrote:
> On Mon, Mar 28, 2011 at 9:26 PM, Rémy Oudompheng
> <remyoudompheng at gmail.com> wrote:
> > On 2011/3/28 Rémy Oudompheng <remyoudompheng at gmail.com> wrote:
> >> Many alpm_option_get/set_*() functions already check this
> >> and set pm_errno to the right value, but not all, so
> >> this improves consistency.
> >
> > I just noticed the ASSERT..RET_ERR construct, should it be the
> > preferred way of implementing such things ?
> >
> 
> I was going to say a macro would be nice for that repetitive stuff.
> 
> And indeed we already have them and there is already that code :
> ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));

I just sent another patch using the macro.

Rémy.


More information about the pacman-dev mailing list