Skip to content

Commit 24c9453

Browse files
committed
[core] Minor fixes for SFX
1 parent 7f53601 commit 24c9453

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

applications/games_menu/modules/preset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ void ShowPresetMenu(int game_index)
15071507
&menu_data.border_color, &menu_data.control_top_color, &body_color, &menu_data.control_bottom_color,
15081508
&OnViewIndexChangedEvent);
15091509

1510-
char sfx_path[50];
1510+
char sfx_path[NAME_MAX];
15111511
int volume = GetVolumeFromSettings();
15121512
if (ds_sfx_is_enabled(DS_SFX_CLICK2))
15131513
{

applications/games_menu/modules/system_menu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ void ShowSystemMenu()
160160
, true, true, form_font, &menu_data.border_color, &menu_data.control_top_color, &body_color, &menu_data.control_bottom_color,
161161
&OnSystemViewIndexChangedEvent);
162162

163-
char sfx_path[50];
163+
char sfx_path[NAME_MAX];
164164
int volume = GetVolumeFromSettings();
165165
if (ds_sfx_is_enabled(DS_SFX_CLICK2))
166166
{

include/sfx.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ typedef enum {
2525

2626
int ds_sfx_play(ds_sfx_t sfx);
2727
int ds_sfx_is_enabled(ds_sfx_t sfx);
28-
void ds_sfx_get_wav(char sfx_path[], int sfx_sel);
28+
void ds_sfx_get_wav(char sfx_path[], ds_sfx_t sfx_sel);
29+
2930

3031
#endif /* _DS_SFX_H */

src/sfx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ static int ds_sfx_get_volume() {
178178
return settings->audio.volume;
179179
}
180180

181-
void ds_sfx_get_wav(char sfx_path[], int sfx_sel) {
182-
if (sfx_sel >= 0) {
181+
void ds_sfx_get_wav(char sfx_path[], ds_sfx_t sfx_sel) {
182+
if (sfx_sel >= 0 && sfx_sel < DS_SFX_LAST) {
183183
snprintf(sfx_path, NAME_MAX, "%s/sfx/%s.wav", getenv("PATH"), sys_sfx_name[sfx_sel]);
184184
}
185185
else {

0 commit comments

Comments
 (0)