Remove the “len” defaulted parameter from CommandReturnObject::AppendMessage, AppendWarning and AppendError. Nobody was using them, and it meant if you accidentally used the AppendWarning when you meant AppendWarningWithFormat with an integer in the format string, it would compile and then return your string plus some unknown amount of junk.

llvm-svn: 170266
This commit is contained in:
Jim Ingham
2012-12-15 02:40:54 +00:00
parent 2e1f745da7
commit 17fafa155c
4 changed files with 26 additions and 23 deletions

View File

@@ -281,7 +281,17 @@ SBCommandReturnObject::PutCString(const char* string, int len)
{
if (m_opaque_ap.get())
{
m_opaque_ap->AppendMessage(string, len);
if (len == 0)
{
return;
}
else if (len > 0)
{
std::string buffer(string, len);
m_opaque_ap->AppendMessage(buffer.c_str());
}
else
m_opaque_ap->AppendMessage(string);
}
}