avoid trying to fwrite to an unopened file

SVN revision: 56140
This commit is contained in:
Mike Blumenkrantz 2011-01-15 19:53:11 +00:00
parent 9e6ff792cd
commit 20a92cd4f7
1 changed files with 4 additions and 1 deletions

View File

@ -319,7 +319,10 @@ output(void)
exit (-1);
}
if (!(f = fopen(out, "wb")))
ERR("Could not open file: %s", out);
{
ERR("Could not open file: %s", out);
exit (-1);
}
if (fwrite(font, fontsize, 1, f) != 1)
ERR("Could not write font: %s", strerror(errno));
if (f) fclose(f);