[Lldb-commits] [lldb] r203654 - Replace some Windows specific string functions with std::string.

Hafiz Abid Qadeer hafiz_abid at mentor.com
Wed Mar 12 03:53:50 PDT 2014


Author: abidh
Date: Wed Mar 12 05:53:50 2014
New Revision: 203654

URL: http://llvm.org/viewvc/llvm-project?rev=203654&view=rev
Log:
Replace some Windows specific string functions with std::string.

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

Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=203654&r1=203653&r2=203654&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Wed Mar 12 05:53:50 2014
@@ -936,12 +936,11 @@ FileSpec::EnumerateDirectory
     if (dir_path && dir_path[0])
     {
 #if _WIN32
-        char szDir[MAX_PATH];
-        strcpy_s(szDir, MAX_PATH, dir_path);
-        strcat_s(szDir, MAX_PATH, "\\*");
+        std::string szDir(dir_path);
+        szDir += "\\*";
 
         WIN32_FIND_DATA ffd;
-        HANDLE hFind = FindFirstFile(szDir, &ffd);
+        HANDLE hFind = FindFirstFile(szDir.c_str(), &ffd);
 
         if (hFind == INVALID_HANDLE_VALUE)
         {





More information about the lldb-commits mailing list