Skip to content

Commit

Permalink
Fixed a problem with disk browsing for Nukinja Densetsu that could ca…
Browse files Browse the repository at this point in the history
…use it to crash.
  • Loading branch information
bubio committed Oct 23, 2023
1 parent 5abb5db commit 2ab3a18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Builder/Linux/dist_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

# Debian and Ubuntu
# sudo apt install build-essentials cmake sdl2-dev
# sudo apt install build-essentials cmake libsdl2-dev

# Fedora
# sudo dnf groupinstall "Development Tools"
Expand Down
5 changes: 2 additions & 3 deletions Source/UI/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,9 @@ void Menu::EnterDrive1(int id)
const char* disk_name = diskmgr[0]->GetName(loop);
list->AddButton(disk_name, MENU_DRIVE1_BANK0 + loop);
#else

// To convert from UTF to SJIS at display time, keep internally in UTF.
const char* disk_name = diskmgr[0]->GetName(loop);
char* disk_name_utf = (char*)SDL_malloc(strlen(disk_name) * 2 + 1);
char* disk_name_utf = (char*)SDL_malloc(strlen(disk_name) * 3 + 1);
converter->SjisToUtf(disk_name, disk_name_utf);
list->AddButton(disk_name_utf, MENU_DRIVE1_BANK0 + loop);
SDL_free(disk_name_utf);
Expand Down Expand Up @@ -343,7 +342,7 @@ void Menu::EnterDrive2(int id)
#else
// To convert from UTF to SJIS at display time, keep internally in UTF.
const char* disk_name = diskmgr[1]->GetName(loop);
char* disk_name_utf = (char*)SDL_malloc(strlen(disk_name) * 2 + 1);
char* disk_name_utf = (char*)SDL_malloc(strlen(disk_name) * 3 + 1);
converter->SjisToUtf(disk_name, disk_name_utf);
list->AddButton(disk_name_utf, MENU_DRIVE2_BANK0 + loop);
SDL_free(disk_name_utf);
Expand Down

0 comments on commit 2ab3a18

Please sign in to comment.