Segmentation Fault occurs if program is executed in a directory without
write privileges.
Patch provided exits gracefully if *fp is NULL before fprintf's attempt
to write to non-existent file.
- Add LICENSE BSD3CLAUSE
PR: 268661
Reported by: eylusion@gmail.com