Skip to content

Commit

Permalink
fix pclose before fgets in init_menu_system
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent-FK <[email protected]>
  • Loading branch information
Vincent-FK committed Apr 17, 2021
1 parent 152bae7 commit 356fe72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RetroFE/Source/Menu/MenuMode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ void MenuMode::init_menu_system_values(){
volume_percentage = 50; ///wrong value: setting default to 50
}
else{
pclose(fp);
fgets(res, sizeof(res)-1, fp);
pclose(fp);

/// Check if Volume is a number (at least the first char)
if(res[0] < '0' || res[0] > '9'){
Expand All @@ -420,8 +420,8 @@ void MenuMode::init_menu_system_values(){
brightness_percentage = 50; ///wrong value: setting default to 50
}
else{
pclose(fp);
fgets(res, sizeof(res)-1, fp);
pclose(fp);

/// Check if brightness is a number (at least the first char)
if(res[0] < '0' || res[0] > '9'){
Expand Down

0 comments on commit 356fe72

Please sign in to comment.