Commit f5d3cb23 authored by Chen Bill's avatar Chen Bill

fix FileSystem::TraversalDir

parent b05e0c96
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#ifdef _WIN32 #ifdef _WIN32
#include <wchar.h>
#define NOMINMAX #define NOMINMAX
#include <Windows.h> #include <Windows.h>
...@@ -89,8 +90,7 @@ public: ...@@ -89,8 +90,7 @@ public:
static void TraversalDir(const wchar_t* wpath, const std::function<void(const wchar_t*, bool)>& cb) { static void TraversalDir(const wchar_t* wpath, const std::function<void(const wchar_t*, bool)>& cb) {
wchar_t findstr[1024]; wchar_t findstr[1024];
wcscpy(findstr, wpath); swprintf(findstr, 1024, L"%s/*", wpath);
wcscat(findstr, L"/*");
WIN32_FIND_DATAW fdataw; WIN32_FIND_DATAW fdataw;
HANDLE fh = FindFirstFileW(findstr, &fdataw); HANDLE fh = FindFirstFileW(findstr, &fdataw);
if(fh == INVALID_HANDLE_VALUE) if(fh == INVALID_HANDLE_VALUE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment