summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Core/StreamString.h3
-rw-r--r--lldb/source/Core/StreamString.cpp6
-rw-r--r--lldb/source/Interpreter/CommandObject.cpp4
3 files changed, 11 insertions, 2 deletions
diff --git a/lldb/include/lldb/Core/StreamString.h b/lldb/include/lldb/Core/StreamString.h
index 5c4cd836b2a..76304fff54b 100644
--- a/lldb/include/lldb/Core/StreamString.h
+++ b/lldb/include/lldb/Core/StreamString.h
@@ -37,6 +37,9 @@ public:
void
Clear();
+ bool
+ Empty() const;
+
const char *
GetData () const;
diff --git a/lldb/source/Core/StreamString.cpp b/lldb/source/Core/StreamString.cpp
index e4caef8c1f1..1c6f146f1be 100644
--- a/lldb/source/Core/StreamString.cpp
+++ b/lldb/source/Core/StreamString.cpp
@@ -47,6 +47,12 @@ StreamString::Clear()
m_packet.clear();
}
+bool
+StreamString::Empty() const
+{
+ return GetSize() == 0;
+}
+
const char *
StreamString::GetData () const
{
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp
index af9aa39e7ed..dbbd0936aa0 100644
--- a/lldb/source/Interpreter/CommandObject.cpp
+++ b/lldb/source/Interpreter/CommandObject.cpp
@@ -850,12 +850,12 @@ static
const char *arch_helper()
{
static StreamString g_archs_help;
- if (g_archs_help.GetData() == NULL)
+ if (g_archs_help.Empty())
{
StringList archs;
ArchSpec::AutoComplete(NULL, archs);
g_archs_help.Printf("These are the supported architecture names:\n");
- archs.Join("%s\n", g_archs_help);
+ archs.Join("\n", g_archs_help);
}
return g_archs_help.GetData();
}
OpenPOWER on IntegriCloud