summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp')
-rw-r--r--lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index 8209d23c0ae..d9d399c5eff 100644
--- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -105,7 +105,9 @@ ObjectContainerBSDArchive::Object::Extract (const DataExtractor& data, lldb::off
{
// Strip off any spaces (if the object file name contains spaces it
// will use the extended format above).
- str.erase (str.find(' '));
+ const size_t space_pos = str.find(' ');
+ if (space_pos != std::string::npos)
+ str.erase (space_pos);
ar_name.SetCString(str.c_str());
}
OpenPOWER on IntegriCloud