1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/* * Rule: FIO42-C * Source: wiki * Status: FAIL - Should trigger FIO42-C violation */ #include <stdio.h> #include <fcntl.h> int func(const char *filename) { int fd = open(filename, O_RDONLY, S_IRUSR); if (-1 == fd) { return -1; } /* ... */ return 0; }