void create_file(CAPayload_t bytes, size_t length)
{
FILE *fp = fopen("sample_output.txt", "wb");
void create_file(CAPayload_t bytes, size_t length)
{
FILE *fp = fopen("sample_output.txt", "wb");
- fwrite(bytes, 1, length, fp);
+ if (!fp)
+ {
+ fwrite(bytes, 1, length, fp);
+ }