Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#7 logical error for CPU_ALL in cpu_evaluate

open
nobody
None
5
2007-08-03
2007-08-03
No

The break if a CPU_ALL rule does not match breaks only the inner loop, but does not leave the if, so that an ALL rule will always end up just after the inner loop and thus always return MATCH.

There are basically two possible solutions; either replace the break by a goto or have the loop counter checked afterwards. I chose the latter for this patch, as many people avoid goto.

My patch also fixes a minor issue where negative numbers are printed in some log messages for CPU_ALL and CPU_ANY.

Discussion

  • patch correcting the logic

     
    Attachments