G7710 and Infineat : close the files after having verified that they exist.

This commit is contained in:
Jean-François Milants 2022-10-15 16:52:55 +02:00
parent eb0af22ecf
commit c9e836a02e
2 changed files with 6 additions and 0 deletions

View File

@ -340,13 +340,16 @@ bool WatchFaceCasioStyleG7710::IsAvailable(Pinetime::Controllers::FS& filesystem
return false;
}
filesystem.FileClose(&file);
if (filesystem.FileOpen(&file, "/fonts/7segments_40.bin", LFS_O_RDONLY) < 0) {
return false;
}
filesystem.FileClose(&file);
if (filesystem.FileOpen(&file, "/fonts/7segments_115.bin", LFS_O_RDONLY) < 0) {
return false;
}
filesystem.FileClose(&file);
return true;
}

View File

@ -617,13 +617,16 @@ bool WatchFaceInfineat::IsAvailable(Pinetime::Controllers::FS& filesystem) {
return false;
}
filesystem.FileClose(&file);
if (filesystem.FileOpen(&file, "/fonts/bebas.bin", LFS_O_RDONLY) < 0) {
return false;
}
filesystem.FileClose(&file);
if (filesystem.FileOpen(&file, "/images/pine_small.bin", LFS_O_RDONLY) < 0) {
return false;
}
filesystem.FileClose(&file);
return true;
}