...
| Code Block | ||
|---|---|---|
| ||
char *file_name;
int fd;
/* initialize file_name */
fd = open(file_name, O_CREAT | O_WRONLY);
/* access permissions were missing */
if (fd == -1){
/* handle Error */
}
|
This example also violates EXP37-C. Call functions with the arguments intended by the API.
Compliant Solution: open() (POSIX)
...