On Thu, 2013-08-15 at 17:08 +0200, Michal Židek wrote:
> +static size_t sss_mc_get_strs_offset(struct sss_mc_ctx *mcc)
> +{
> + if (mcc->type == SSS_MC_PASSWD) {
> + return offsetof(struct sss_mc_pwd_data, strs);
> + }
> +
> + return offsetof(struct sss_mc_grp_data, strs);
> +}
Can you use a switch()/case: here?
I know it looks a lot more boilerplate but if we start adding other maps
we'll not risk returning a completely bogus pointer by mistake.
Simo.
--
Simo Sorce * Red Hat, Inc * New York
_______________________________________________
sssd-devel mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel