1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/* * Rule: FIO42-C * Source: wiki * Status: PASS - Should NOT trigger FIO42-C violation */ #include <stdio.h> #include <stdlib.h> int main(void) { FILE *f = fopen(filename, "w"); if (NULL == f) { /* Handle error */ } /* ... */ if (fclose(f) == EOF) { /* Handle error */ } exit(EXIT_SUCCESS); }