Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit 26bda8b

Browse files
Fixed rendering char numbers.
1 parent 4566142 commit 26bda8b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/sound_bank.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ std::array <std::string,10> filepath_textboxes;
6666
char fileNameToLoad[512] = { 0 };
6767
std::uint8_t current_file_button_edit = 0;
6868

69+
70+
6971
void SoundBank::DrawGui_Item()
7072
{
7173
//draw rectangle
@@ -76,8 +78,9 @@ void SoundBank::DrawGui_Item()
7678
for(std::uint8_t i = 0; i < m_sound_accounts.size(); i++)
7779
{
7880
//draw account number
79-
char num = *(std::to_string(i).c_str());
80-
GuiTextBox((Rectangle){leftX,100 + i*30,20,25}, &num, 20, false);
81+
char num[3];
82+
strncpy ( num, std::to_string(i).c_str(), sizeof(num) );
83+
GuiTextBox((Rectangle){leftX,100 + i*30,20,25}, &num[0], 20, false);
8184
//draw textbox with name of sound and account number
8285
if( GuiTextBox((Rectangle){leftX + 25,100 + i*30,100,25},
8386
name_textboxes[i].char_name, 20, name_textboxes[i].name_box_pressed

0 commit comments

Comments
 (0)