mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-06-20 11:43:05 +08:00
Fix for issue #77
This commit is contained in:
parent
9b7e6db906
commit
f662000414
@ -772,12 +772,13 @@ std::unique_ptr<Emboss::FontFile> Emboss::create_font_file(
|
|||||||
|
|
||||||
std::unique_ptr<Emboss::FontFile> Emboss::create_font_file(const char *file_path)
|
std::unique_ptr<Emboss::FontFile> Emboss::create_font_file(const char *file_path)
|
||||||
{
|
{
|
||||||
FILE *file = fopen(file_path, "rb");
|
FILE *file = std::fopen(file_path, "rb");
|
||||||
if (file == nullptr) {
|
if (file == nullptr) {
|
||||||
assert(false);
|
assert(false);
|
||||||
BOOST_LOG_TRIVIAL(error) << "Couldn't open " << file_path << " for reading.";
|
BOOST_LOG_TRIVIAL(error) << "Couldn't open " << file_path << " for reading.";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
ScopeGuard sg([&file]() { std::fclose(file); });
|
||||||
|
|
||||||
// find size of file
|
// find size of file
|
||||||
if (fseek(file, 0L, SEEK_END) != 0) {
|
if (fseek(file, 0L, SEEK_END) != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user