You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@locus.apache.org on 2000/10/06 19:51:25 UTC

cvs commit: xml-xalan/c/src/PlatformSupport XalanOutputStream.cpp XalanOutputStream.hpp

dbertoni    00/10/06 10:51:25

  Modified:    c/src/PlatformSupport XalanOutputStream.cpp
                        XalanOutputStream.hpp
  Log:
  Fixed bug trying to write a strings without null-termination.
  
  Revision  Changes    Path
  1.3       +16 -1     xml-xalan/c/src/PlatformSupport/XalanOutputStream.cpp
  
  Index: XalanOutputStream.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/XalanOutputStream.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanOutputStream.cpp	2000/09/28 14:28:30	1.2
  +++ XalanOutputStream.cpp	2000/10/06 17:51:24	1.3
  @@ -129,7 +129,7 @@
   
   	if (theBufferLength > m_bufferSize)
   	{
  -		doWrite(theBuffer);
  +		doWrite(theBuffer, theBufferLength);
   	}
   	else
   	{
  @@ -432,6 +432,21 @@
   
   		throw;
   	}
  +}
  +
  +
  +
  +void
  +XalanOutputStream::doWrite(
  +			const XalanDOMChar*		theBuffer,
  +			unsigned long			theBufferLength)
  +{
  +	// $$$ ToDo: Revisit this!!!
  +	BufferType	theLocalBuffer(theBuffer, theBuffer + theBufferLength);
  +
  +	theLocalBuffer.push_back(0);
  +
  +	doWrite(&theLocalBuffer[0]);
   }
   
   
  
  
  
  1.2       +5 -0      xml-xalan/c/src/PlatformSupport/XalanOutputStream.hpp
  
  Index: XalanOutputStream.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/XalanOutputStream.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanOutputStream.hpp	2000/09/27 16:24:12	1.1
  +++ XalanOutputStream.hpp	2000/10/06 17:51:24	1.2
  @@ -321,6 +321,11 @@
   	void
   	doWrite(const XalanDOMChar*		theBuffer);
   
  +	void
  +	doWrite(
  +			const XalanDOMChar*		theBuffer,
  +			unsigned long			theBufferLength);
  +
   
   	const TranscodeVectorType::size_type	m_transcoderBlockSize;