...
Code Block |
---|
... FILE * fptr= fopen(file_name, "w"); if (!fptr) { /* Handle Error */ } ... |
Code Block |
Compliant
...
Solution
...
1.
Code Block |
---|
... int fd = open(file_name, O_CREAT | O_EXCL | O_WR_ONLY); if (fd == -1) { /* Handle Error */ } ... |
...
Code Block |
---|
... FILE * fptr= fopen(file_name, "w"); if (!fptr) { /* Handle Error */ } ... |
Code Block |
...
...
Code Block |
---|
... int fd = open(file_name, O_CREAT | O_EXCL | O_WR_ONLY); if (fd == -1) { /* Handle Error */ } ... |