Commit 68e59d91 by Francois Gygi

fixed off-by-one error in buffer size.


git-svn-id: http://qboxcode.org/svn/qb/trunk@748 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 1c23c841
......@@ -15,7 +15,7 @@
// StructuredDocumentHandler.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: StructuredDocumentHandler.C,v 1.9 2009-04-30 22:38:32 fgygi Exp $
// $Id: StructuredDocumentHandler.C,v 1.10 2009-11-30 02:35:35 fgygi Exp $
#if USE_XERCES
......@@ -67,11 +67,11 @@ void StructuredDocumentHandler::characters(const XMLCh* const chars,
Timer tm;
tm.start();
#endif
size_t pos = buffer.size();
// Note: buffer must be able to hold length+1 chars for '\0'
buffer.resize(pos+length+1);
bool status = XMLString::transcode(chars,&buffer[pos],length);
assert(status==true);
char *str = XMLString::transcode(chars);
buffer += str;
XMLString::release(&str);
#if TIMING
tm.stop();
cout << " StructuredDocumentHandler::characters: time: " << tm.real() << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment