Remove the UUID::GetAsCString() method which required a buffer to save the
UUID string in; added UUID::GetAsString() which returns the uuid string in
a std::string. Updated callers to use the new method.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181078 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBModule.cpp b/source/API/SBModule.cpp
index 85bece8..3938fa8 100644
--- a/source/API/SBModule.cpp
+++ b/source/API/SBModule.cpp
@@ -180,15 +180,22 @@
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- static char uuid_string[80];
- const char * uuid_c_string = NULL;
+ static char uuid_string_buffer[80];
+ const char *uuid_c_string = NULL;
+ std::string uuid_string;
ModuleSP module_sp (GetSP ());
if (module_sp)
- uuid_c_string = (const char *)module_sp->GetUUID().GetAsCString(uuid_string, sizeof(uuid_string));
+ uuid_string = module_sp->GetUUID().GetAsString();
+
+ if (!uuid_string.empty())
+ {
+ strncpy (uuid_string_buffer, uuid_string.c_str(), sizeof (uuid_string_buffer));
+ uuid_c_string = uuid_string_buffer;
+ }
if (log)
{
- if (uuid_c_string)
+ if (!uuid_string.empty())
{
StreamString s;
module_sp->GetUUID().Dump (&s);