BUG: Fixed buffer size in MakeXMLSafe.

This commit is contained in:
Brad King 2004-01-21 14:06:44 -05:00
parent d609e037b9
commit cb95dde1e4
1 changed files with 1 additions and 1 deletions

View File

@ -208,7 +208,6 @@ static const char* cmCTestMemCheckResultStrings[] = {
std::string cmCTest::MakeXMLSafe(const std::string& str)
{
cmOStringStream ost;
char buffer[10];
// By uncommenting the lcnt code, it will put newline every 120 characters
//int lcnt = 0;
for (std::string::size_type pos = 0; pos < str.size(); pos ++ )
@ -216,6 +215,7 @@ std::string cmCTest::MakeXMLSafe(const std::string& str)
unsigned char ch = str[pos];
if ( (ch > 126 || ch < 32) && ch != 9 && ch != 10 && ch != 13 )
{
char buffer[33];
sprintf(buffer, "&lt;%d&gt;", (int)ch);
//sprintf(buffer, "&#x%0x;", (unsigned int)ch);
ost << buffer;