summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBCommandReturnObject.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-12-15 02:40:54 +0000
committerJim Ingham <jingham@apple.com>2012-12-15 02:40:54 +0000
commit17fafa155cc4e6e8170c149ee20ef5ac685ee918 (patch)
treee5586c8d436909e2b6072e203e481f9eb56a74ae /lldb/source/API/SBCommandReturnObject.cpp
parent2e1f745da77279d3e06822ffa3484ad325810874 (diff)
downloadbcm5719-llvm-17fafa155cc4e6e8170c149ee20ef5ac685ee918.tar.gz
bcm5719-llvm-17fafa155cc4e6e8170c149ee20ef5ac685ee918.zip
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
Diffstat (limited to 'lldb/source/API/SBCommandReturnObject.cpp')
-rw-r--r--lldb/source/API/SBCommandReturnObject.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lldb/source/API/SBCommandReturnObject.cpp b/lldb/source/API/SBCommandReturnObject.cpp
index 4d0ffc75fe3..4714829c592 100644
--- a/lldb/source/API/SBCommandReturnObject.cpp
+++ b/lldb/source/API/SBCommandReturnObject.cpp
@@ -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);
}
}
OpenPOWER on IntegriCloud