Skip to content

Commit 6937cdd

Browse files
committed
small fix to stat mtime
1 parent 6ef08d9 commit 6937cdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/filesystem/fat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static int file_stat(filesystem_t *fs, const char *path, struct stat *st) {
399399

400400
struct tm mtime = {0};
401401
mtime.tm_year = (f.fdate >> 9) + 80;
402-
mtime.tm_mon = (f.fdate >> 5) & 0b1111;
402+
mtime.tm_mon = ((f.fdate >> 5) & 0b1111) - 1;
403403
mtime.tm_mday = f.fdate & 0b11111;
404404
mtime.tm_hour = f.ftime >> 11;
405405
mtime.tm_min = (f.ftime >> 5) & 0b111111;

0 commit comments

Comments
 (0)