Versions Compared

Key

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

...

Code Block
bgColor#ccccff
/* First the options that are only allowed for root */
if (getuid() == 0 || geteuid() != 0) {
  /* ... */
}

Compliant

...

Solution

A function pointer can be compared to a null function pointer of the same type.

...

Code Block
bgColor#FFcccc
int do_xyz(void); 
 
if (do_xyz) { 
  /* handle error */ 
} 

Compliant Solution

In this compliant solution, the function do_xyz() is invoked and the return value is compared to 0.

...