Fix getDirectoryItems on windows;

This commit is contained in:
bjorn 2020-01-22 16:09:35 -08:00
parent ddcdce25dc
commit 0f338c3ebd
1 changed files with 6 additions and 1 deletions

View File

@ -137,8 +137,13 @@ bool fs_mkdir(const char* path) {
bool fs_list(const char* path, fs_list_cb* callback, void* context) {
WCHAR wpath[FS_PATH_MAX];
if (!MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, FS_PATH_MAX)) {
int length = MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, FS_PATH_MAX);
if (length == 0 || length + 3 >= FS_PATH_MAX) {
return false;
} else {
wcscat(wpath, L"/*");
}
WIN32_FIND_DATAW findData;