diff options
| author | B. Watson <urchlay@slackware.uk> | 2025-11-29 01:02:02 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2025-11-29 01:02:02 -0500 |
| commit | 3340301b02ae647cdb286112c32772bda0faf503 (patch) | |
| tree | 6847f4f17dee95c5801e3e80607f2c1f6c1f983c /src/alf.c | |
| parent | 0861fc6fc6614084bad79db36eeae4eefd75ff9e (diff) | |
| download | alftools-3340301b02ae647cdb286112c32772bda0faf503.tar.gz | |
unalf: actually use timestamps from the alf header (and add -T option to not use them).
Diffstat (limited to 'src/alf.c')
| -rw-r--r-- | src/alf.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -143,7 +143,8 @@ unsigned long get_msdos_date_time(void) { msdos_year = tm->tm_year + 1900 - 1980; - ms_date = tm->tm_mday | (tm->tm_mon << 5) | (msdos_year << 9); + /* tm_mon + 1 because MS uses 1-12 for months, and struct tm uses 0-11 */ + ms_date = (tm->tm_mday) | (((tm->tm_mon + 1) << 5)) | (msdos_year << 9); ms_time = (tm->tm_sec >> 1) | (tm->tm_min << 5) | (tm->tm_hour << 11); return ms_date | (ms_time << 16); } |
