summaryrefslogtreecommitdiff
path: root/vcl/source/fontsubset/ttcr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/fontsubset/ttcr.cxx')
-rw-r--r--vcl/source/fontsubset/ttcr.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index 5d2f337c6c88..92ecfa9a87a6 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -272,18 +272,19 @@ SFErrCodes StreamToFile(TrueTypeCreator *_this, const char* fname)
FILE* fd;
if ((r = StreamToMemory(_this, &ptr, &length)) != SFErrCodes::Ok) return r;
- if (fname && (fd = fopen(fname, "wb")) != nullptr)
+ r = SFErrCodes::BadFile;
+ if (fname)
{
- if (fwrite(ptr, 1, length, fd) != length) {
- r = SFErrCodes::FileIo;
- } else {
- r = SFErrCodes::Ok;
+ fd = fopen(fname, "wb");
+ if (fd)
+ {
+ if (fwrite(ptr, 1, length, fd) != length) {
+ r = SFErrCodes::FileIo;
+ } else {
+ r = SFErrCodes::Ok;
+ }
+ fclose(fd);
}
- fclose(fd);
- }
- else
- {
- r = SFErrCodes::BadFile;
}
free(ptr);
return r;