Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

h2.
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 */
}
...