summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-11-26 15:11:16 +0100
committerPavel Labath <pavel@labath.sk>2019-11-26 15:16:26 +0100
commit5871cba86172c5bd947952a9441acf80332455ea (patch)
tree6492abe0745f042be454af27a0e1c146ddfca719 /lldb
parent2bd252ea894189f77e09755cf6951727e1d03a74 (diff)
downloadbcm5719-llvm-5871cba86172c5bd947952a9441acf80332455ea.tar.gz
bcm5719-llvm-5871cba86172c5bd947952a9441acf80332455ea.zip
[lldb] Avoid snprintf in PlatformRemoteDarwinDevice
This quashes a -Wformat-truncation warning.
Diffstat (limited to 'lldb')
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp33
1 files changed, 14 insertions, 19 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
index e9bb2929318..0aa129c808d 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
@@ -449,12 +449,10 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file,
Status error;
char platform_file_path[PATH_MAX];
if (platform_file.GetPath(platform_file_path, sizeof(platform_file_path))) {
- char resolved_path[PATH_MAX];
-
const char *os_version_dir = GetDeviceSupportDirectoryForOSVersion();
if (os_version_dir) {
- ::snprintf(resolved_path, sizeof(resolved_path), "%s/%s", os_version_dir,
- platform_file_path);
+ std::string resolved_path =
+ (llvm::Twine(os_version_dir) + "/" + platform_file_path).str();
local_file.SetFile(resolved_path, FileSpec::Style::native);
FileSystem::Instance().Resolve(local_file);
@@ -466,31 +464,28 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file,
return error;
}
- ::snprintf(resolved_path, sizeof(resolved_path), "%s/Symbols.Internal/%s",
- os_version_dir, platform_file_path);
+ resolved_path = (llvm::Twine(os_version_dir) + "/Symbols.Internal/" +
+ platform_file_path)
+ .str();
local_file.SetFile(resolved_path, FileSpec::Style::native);
FileSystem::Instance().Resolve(local_file);
if (FileSystem::Instance().Exists(local_file)) {
- if (log) {
- LLDB_LOGF(
- log,
- "Found a copy of %s in the DeviceSupport dir %s/Symbols.Internal",
- platform_file_path, os_version_dir);
- }
+ LLDB_LOGF(
+ log,
+ "Found a copy of %s in the DeviceSupport dir %s/Symbols.Internal",
+ platform_file_path, os_version_dir);
return error;
}
- ::snprintf(resolved_path, sizeof(resolved_path), "%s/Symbols/%s",
- os_version_dir, platform_file_path);
+ resolved_path =
+ (llvm::Twine(os_version_dir) + "/Symbols/" + platform_file_path)
+ .str();
local_file.SetFile(resolved_path, FileSpec::Style::native);
FileSystem::Instance().Resolve(local_file);
if (FileSystem::Instance().Exists(local_file)) {
- if (log) {
- LLDB_LOGF(log,
- "Found a copy of %s in the DeviceSupport dir %s/Symbols",
- platform_file_path, os_version_dir);
- }
+ LLDB_LOGF(log, "Found a copy of %s in the DeviceSupport dir %s/Symbols",
+ platform_file_path, os_version_dir);
return error;
}
}
OpenPOWER on IntegriCloud