Browse Source

fix pclose before fgets in init_menu_system

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
Michel-FK 3 years ago
parent
commit
2aa9e10dca
1 changed files with 2 additions and 2 deletions
  1. 2 2
      platform/common/menu_pico.c

+ 2 - 2
platform/common/menu_pico.c

@@ -443,8 +443,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'){
@@ -464,8 +464,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'){