Skip to content

Commit

Permalink
Fix Windows dialog folder titles
Browse files Browse the repository at this point in the history
Same fix as in cf946e3, which was not done for the folder implementation.
  • Loading branch information
Semphris authored and slouken committed Jan 19, 2025
1 parent 32965b4 commit 43b54b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dialog/windows/SDL_windowsdialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ void windows_ShowFolderDialog(void *ptr)
title_len = 0;
}

int title_wlen = MultiByteToWideChar(CP_UTF8, 0, title, title_len, NULL, 0);
int title_wlen = MultiByteToWideChar(CP_UTF8, 0, title, -1, NULL, 0);

if (title_wlen < 0) {
title_wlen = 0;
Expand All @@ -452,7 +452,7 @@ void windows_ShowFolderDialog(void *ptr)
return;
}

MultiByteToWideChar(CP_UTF8, 0, title, title_len, title_w, title_wlen);
MultiByteToWideChar(CP_UTF8, 0, title, -1, title_w, title_wlen);
}

wchar_t buffer[MAX_PATH];
Expand Down

0 comments on commit 43b54b3

Please sign in to comment.