Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this noncompliant code example, a bitwise expression is used in a conditional expression.

Code Block
bgColor#FFcccc
langc
if (!(getuid() & geteuid() == 0)) { 
  /* ... */ 
} 

...

This compliant solution uses the && operator for the logical operation within the conditional expression.

Code Block
bgColor#ccccff
langc
if (!(getuid() && geteuid() == 0)) {
  /* ... */
}

...