mirror of
https://github.com/intel/llvm.git
synced 2026-01-18 07:57:36 +08:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user