tng 2003/01/09 12:59:44
Modified: c/src/xercesc/framework LocalFileFormatTarget.cpp
Log:
[Bug 15928] Output with LocalFileFormatTarget fails silently.
Revision Changes Path
1.4 +11 -1 xml-xerces/c/src/xercesc/framework/LocalFileFormatTarget.cpp
Index: LocalFileFormatTarget.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/LocalFileFormatTarget.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LocalFileFormatTarget.cpp 27 Nov 2002 18:09:25 -0000 1.3
+++ LocalFileFormatTarget.cpp 9 Jan 2003 20:59:44 -0000 1.4
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.4 2003/01/09 20:59:44 tng
+ * [Bug 15928] Output with LocalFileFormatTarget fails silently.
+ *
* Revision 1.3 2002/11/27 18:09:25 tng
* [Bug 13447] Performance: Using LocalFileFormatTarget with DOMWriter is very slow.
*
@@ -71,6 +74,7 @@
#include <xercesc/framework/LocalFileFormatTarget.hpp>
#include <xercesc/util/PlatformUtils.hpp>
+#include <xercesc/util/IOException.hpp>
#include <string.h>
XERCES_CPP_NAMESPACE_BEGIN
@@ -83,6 +87,9 @@
{
fSource = XMLPlatformUtils::openFileToWrite(fileName);
+ if (!fSource)
+ ThrowXML1(IOException, XMLExcepts::File_CouldNotOpenFile, fileName);
+
// Buffer is one larger than capacity, to allow for zero term
fDataBuf = new XMLByte[fCapacity+4];
@@ -98,6 +105,9 @@
, fCapacity(1023)
{
fSource = XMLPlatformUtils::openFileToWrite(fileName);
+
+ if (!fSource)
+ ThrowXML1(IOException, XMLExcepts::File_CouldNotOpenFile, fileName);
// Buffer is one larger than capacity, to allow for zero term
fDataBuf = new XMLByte[fCapacity+4];
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]