On 08/15/2013 06:38 PM, Michal Židek wrote:
On 08/15/2013 05:31 PM, Simo Sorce wrote:
> 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.
>
Ok. New patches are attached.
Thanks
Michal
Actually, I think it looks better without the ret variable. So again,
new patches are attached.
Michal