Skip to content

Commit 8ddb074

Browse files
kyle-sylvestreslouken
authored andcommitted
bugfix advancing UTF-8 length in UTF-16 string
1 parent dcdbc0b commit 8ddb074

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dialog/windows/SDL_windowsdialog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ void windows_ShowFileDialog(void *ptr)
273273
SDL_strlcpy(chosen_file, chosen_folder, MAX_PATH);
274274
chosen_file[chosen_folder_size] = '\\';
275275

276-
file_ptr += SDL_strlen(chosen_folder) + 1;
276+
file_ptr += SDL_wcslen(file_ptr) + 1;
277277

278278
while (*file_ptr) {
279279
nfiles++;
@@ -308,7 +308,7 @@ void windows_ShowFileDialog(void *ptr)
308308
return;
309309
}
310310

311-
file_ptr += SDL_strlen(chosen_file) + 1 - diff;
311+
file_ptr += SDL_wcslen(file_ptr) + 1;
312312

313313
chosen_files_list[nfiles - 1] = SDL_strdup(chosen_file);
314314

0 commit comments

Comments
 (0)