From c16b4af0d7aa1bd6b5657474cc46482aa158c3ec Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Fri, 3 May 2013 23:56:12 +0000 Subject: 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. llvm-svn: 181078 --- lldb/source/API/SBModule.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lldb/source/API/SBModule.cpp') diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index 85bece899964..3938fa8846d0 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -180,15 +180,22 @@ SBModule::GetUUIDString () const { 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); -- cgit v1.2.3