[Lldb-commits] [lldb] r160979 - /lldb/trunk/source/Host/common/Host.cpp

Filipe Cabecinhas me at filcab.net
Mon Jul 30 11:56:10 PDT 2012


Author: filcab
Date: Mon Jul 30 13:56:10 2012
New Revision: 160979

URL: http://llvm.org/viewvc/llvm-project?rev=160979&view=rev
Log:
Make glibc and its developers happy. Circumvent the lack of strlcat in glibc.

Modified:
    lldb/trunk/source/Host/common/Host.cpp

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=160979&r1=160978&r2=160979&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Mon Jul 30 13:56:10 2012
@@ -1016,7 +1016,9 @@
                         ::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);





More information about the lldb-commits mailing list