Eo: Fix a potentially dangerous lack of {}.

You should always use curly brackets. Especially when the inside statement
has its own curlys. This can be confusing and has already lead to bugs in
many projects.
This commit is contained in:
Tom Hacohen 2015-06-18 13:44:51 +01:00
parent d72aa3fecb
commit d85029a5c0
1 changed files with 8 additions and 6 deletions

View File

@ -722,12 +722,14 @@ _eo_api_desc_get(const void *api_func, const _Eo_Class *klass, const _Eo_Class *
* function name itself. Slow, but this should rarely happen.
*/
for (unsigned int i = 0; i < cur_klass->desc->ops.count; i++)
if (api_name && !strcmp(api_name, op_descs[i].api_name))
{
if (op_descs[i].api_func == NULL || op_descs[i].api_func == ((void (*)())-1))
break;
return &op_descs[i];
}
{
if (api_name && !strcmp(api_name, op_descs[i].api_name))
{
if (op_descs[i].api_func == NULL || op_descs[i].api_func == ((void (*)())-1))
break;
return &op_descs[i];
}
}
#endif
}
}