Hi Jan,
Jan Safranek wrote:
>> The loop in cgroup_parse_rules() is a little long now, and it is not
>> easy to read the loop.
>> Then, This patch shortens the loop for the readability.
>
> checkpatch.pl does not like assignments in if conditions:
>
> ERROR: do not use assignment in if condition
> #30: FILE: src/api.c:251:
> + if ((itr = strchr(rule, '#')))
>
> ERROR: do not use assignment in if condition
> #34: FILE: src/api.c:255:
> + if ((itr = strchr(rule, '\n')))
>
> ERROR: do not use assignment in if condition
> #71: FILE: src/api.c:364:
> + if (!(itr = cg_skip_unused_charactors_in_rule(buff))) {
>
>
> I know, these errors were already there...
I didn't know checkpatch.pl is usefull besides the patch of linux kernel.
Thank you for good points, and I will fix them.
>> [snip]
>> - /* If there's nothing left, we can ignore this line. */
>> - if (!strlen(itr))
>> + if (!(itr = cg_skip_unused_charactors_in_rule(buff))) {
>> + memset(buff, '\0', sizeof(buff));
>
> Why memset? fgets should always put '\0' at the end.
You are right. memset() is not necessary.
I will fix it also.
Thanks
Ken'ichi Ohmichi
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel