[pacman-dev] [PATCH 2/2] Alpm pkg accessors: ensure pkg argument is non-NULL

Rémy Oudompheng remyoudompheng at gmail.com
Tue Jun 14 14:09:44 EDT 2011


On 2011/6/14 Dan McGee <dan at archlinux.org> wrote:
>  alpm_list_t SYMEXPORT *alpm_pkg_get_provides(pmpkg_t *pkg)
>  {
> +       ASSERT(pkg != NULL, return NULL);
>        pkg->handle->pm_errno = 0;
>        return pkg->ops->get_provides(pkg);
>  }

Hello Dan,

In this patch we should really set pkg->handle->errno to something:
either PM_ERR_WRONG_ARGS or create a PM_ERR_PKG_NULL for this purpose,
especially for all functions that return an alpm_list_t where NULL
already means "empty list". I guess it supports the idea of having a
handle in the package.

-- 
Rémy.


More information about the pacman-dev mailing list