Versions Compared

Key

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

...

This function increments the value pointed to by its argument. It also ensures that its argument is not a null pointer. But the pointer can still be invalid, causing the function to corrupt memory and terminate abnormally.

Code Block
bgColor#FFCCCC
void incr(int *intptr) {
  if (intptr == NULL) {
    /* handle error */
  }
  *intptr++;
}

...