Use c_str() to enforce 0 termination.

This commit is contained in:
Axel Naumann 2013-09-24 15:26:08 +02:00 committed by sftnight
parent 2e451da58e
commit 40aa591bb8

View File

@ -194,11 +194,9 @@ namespace cling {
DynamicLibraryManager::loadLibrary(const std::string& filename,
bool permanent, bool* tryCode) {
// If it's not an absolute path, prepend "lib"
llvm::SmallVector<char, 128> Absolute(filename.c_str(),
filename.c_str() + filename.length());
Absolute.push_back(0);
SmallString<128> Absolute((llvm::StringRef(filename)));
llvm::sys::fs::make_absolute(Absolute);
bool isAbsolute = filename == Absolute.data();
bool isAbsolute = filename == Absolute.c_str();
bool exists = false;
bool isDyLib = false;
LoadLibResult res = tryLinker(filename, permanent, isAbsolute, exists,