Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Unchecked access to a file pointer - inviting null pointe problems

...

Code Block
bgColor#ccccff
const char *filename = "test.txt";
FILE *fptr = fopen(filename, "r");

/* Check fptr for validity */
int c = getc(fptr);

Non-Compliant Code Example: putc()

...