Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_file_font #19

Open
nottledim opened this issue Nov 10, 2017 · 3 comments
Open

load_file_font #19

nottledim opened this issue Nov 10, 2017 · 3 comments

Comments

@nottledim
Copy link

First time I've seen a "goto" in code for a long time. Guess what - there a bug!

in component/tft/tft.c

If, for some reason the file size check (or one of the other tests) fails after the file is opened it's essential that the file closed otherwise spiffs quickly runs out of file handles.

adding a close(fhndl) after the exit label helps.

@loboris
Copy link
Owner

loboris commented Nov 11, 2017

Thank you for reporting this.
The file should be opened after the size check. It is closed imediately after reading, so there is no need to close it after exit label.

@nottledim
Copy link
Author

That's a better solution, thanks

@nottledim
Copy link
Author

Whilst you're fixing that would you consider making error numbers reported by compile_font_file and load_file_font unique. Also perhaps print err as well err_msg in penultimate line of compile_font_file.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants