diff options
author | Douglas Mencken <dougmencken@gmail.com> | 2014-09-07 05:56:50 -0400 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-09 15:49:09 +0000 |
commit | 9e773854c8cd24e526a6beed6bee74313a7fd47b (patch) | |
tree | a0f69cabe5db3cb57566e88dd1e88e141b1df8d4 /l10ntools/source | |
parent | a6ac672eea5fb563346024f9adfc66ab5011cb5f (diff) |
l10ntools/source/export.cxx: add sanity check to aOutput.mSimple
Change-Id: I05074760f189dfc00ce14ec33002609a56797a6d
Reviewed-on: https://gerrit.libreoffice.org/11321
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'l10ntools/source')
-rw-r--r-- | l10ntools/source/export.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index efd336d659b1..49805ccc83c0 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -233,6 +233,11 @@ Export::Export( { aOutput.mSimple = new std::ofstream(); aOutput.mSimple->open(rOutput.getStr(), std::ios_base::out | std::ios_base::trunc); + if (!aOutput.mSimple->is_open()) + { + std::fprintf(stderr, "ERROR : Can't open file %s\n", rOutput.getStr()); + std::exit(EXIT_FAILURE); + } if ( bUTF8BOM ) WriteUTF8ByteOrderMarkToOutput(); } |