fix pclose before fgets in init_menu_system

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK
2021-04-17 22:22:49 +02:00
parent 009d007fc9
commit 2aa9e10dca

View File

@@ -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'){