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>
This commit is contained in:
committed by
Caolán McNamara
parent
a6ac672eea
commit
9e773854c8
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user