You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by we...@gmx.de on 2008/04/08 21:09:41 UTC

MemBufFormatTarget possible bug

hi

i possible discovered a bug?! in MemBufFormatTarget Constructor. When initializing a new object with initCapacity greater than you need, then the first 10 characters of the buffer-string are corrupt:

MemBufFormatTarget* memtarget = new MemBufFormatTarget(1024);
...
string result((char*)memtarget->getRawBuffer(),
			memtarget->getLen()*sizeof(XMLByte));
cout <<  result << endl;

output:
��������b1">      some b1 text
    </b>
<b b2n="b2">      some b2 text
    </b>

However if i initialize the constructor with 0 then is everything fine :)

MemBufFormatTarget* memtarget = new MemBufFormatTarget(0);
---- same code as above---

output:
<b b1n="b1">      some b1 text
    </b>
<b b2n="b2">       some b2 text
</b>

It is my first post here, i hope it is in the right place.

greetings
  Affe


-- 
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games! 
http://games.entertainment.gmx.net/de/entertainment/games/free