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

fatfs stat() times can be off by an hour #1369

Closed
lllucius opened this issue Dec 10, 2017 · 1 comment
Closed

fatfs stat() times can be off by an hour #1369

lllucius opened this issue Dec 10, 2017 · 1 comment

Comments

@lllucius
Copy link

Because the "tm" struct isn't completely cleared, the tm_isdst field can have random values. This can cause mktime() to adjust the time incorrectly depending on the passed in value (see mktime man page).

The attached patch fixed the problem.

vfs_fat_stat.diff.gz

@igrr
Copy link
Member

igrr commented Dec 10, 2017

Hi @lllucius, thanks for reporting this. We happen to have a fix for this currently in review, should be merged in the next few days.

@igrr igrr closed this as completed in dfee6e8 Dec 13, 2017
igrr added a commit that referenced this issue Dec 29, 2017
Replace explicit masks and shifts with bit fields when working with FATFS date and time representations. Also zero-initialize remaining members of struct tm.

Fixes #1369.
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