summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2012-07-30 18:56:10 +0000
committerFilipe Cabecinhas <me@filcab.net>2012-07-30 18:56:10 +0000
commitcffbd09a561db29e9543874816749ead78dfb845 (patch)
treeb0bfa76a7814bbb7f2635f2a29f24aa3ef823533 /lldb/source/Host
parent5c490f1b8fe21e8a67759c26ee7c668e67604e2d (diff)
downloadbcm5719-llvm-cffbd09a561db29e9543874816749ead78dfb845.tar.gz
bcm5719-llvm-cffbd09a561db29e9543874816749ead78dfb845.zip
Make glibc and its developers happy. Circumvent the lack of strlcat in glibc.
llvm-svn: 160979
Diffstat (limited to 'lldb/source/Host')
-rw-r--r--lldb/source/Host/common/Host.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index 06beb11fa8c..07e966bdbb9 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -1016,7 +1016,9 @@ Host::GetLLDBPath (PathType path_type, FileSpec &file_spec)
::strncpy (framework_pos, "/Resources/Python", PATH_MAX - (framework_pos - raw_path));
}
#else
- ::strlcat(raw_path, "/python", sizeof(raw_path));
+ // We may get our string truncated. Should we protect
+ // this with an assert?
+ ::strncat(raw_path, "/python", sizeof(raw_path) - strlen(raw_path) - 1);
#endif
FileSpec::Resolve (raw_path, resolved_path, sizeof(resolved_path));
g_lldb_python_dir.SetCString(resolved_path);
OpenPOWER on IntegriCloud