sqc 0.4.13

Software Code Quality - CERT C compliance checker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
 * Rule: ERR00-C
 * Source: wiki
 * Status: FAIL - Return value from fopen not checked
 */

#include <stdio.h>

void read_data(void) {
    int value;
    FILE *fp = fopen("data.txt", "r");
    fscanf(fp, "%d", &value);
    fclose(fp);
}