epp: avoid to rely on undefined behavior for fopen.

In the case we didn't define the file to save to, fopen would have
been called with a NULL parameter. The result of that call is not
really defined and could have led to some crash at some point.
This commit is contained in:
Cedric Bail 2013-11-05 16:28:56 +09:00
parent ec1ba32690
commit 11bad33813
1 changed files with 2 additions and 1 deletions

View File

@ -7448,8 +7448,9 @@ extern cpp_options options;
void
using_file(const char *filename, const char type)
{
FILE *f;
FILE *f = NULL;
if (!options.watchfile) return;
f = fopen(options.watchfile, "a");
if (!f) return;
if (anotate)