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 24d02b6 commit 73b8e1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,8 @@ void 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 @@ -509,8 +509,8 @@ void 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 73b8e1d

Please sign in to comment.