diff options
| author | B. Watson <urchlay@slackware.uk> | 2025-12-02 14:58:10 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2025-12-02 14:58:10 -0500 |
| commit | 8998af28a197babbeaa5ae828f1229e499b193c1 (patch) | |
| tree | c74b0625595b34c2637bee9babf290f444766c86 /src/alf.c | |
| parent | ee459dea483ae556ca16a2a5dc9cbb26e26bb425 (diff) | |
| download | alftools-8998af28a197babbeaa5ae828f1229e499b193c1.tar.gz | |
alf: Use 0 datestamp if year out of range; unalf: Display 0 datestamps as <none>.
Diffstat (limited to 'src/alf.c')
| -rw-r--r-- | src/alf.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -108,6 +108,11 @@ unsigned long get_msdos_date_time(void) { else tm = localtime(&t); + /* use a 0 timestamp if the year's out of range, unalf will + display it as <none>. */ + if(tm->tm_year < 1980 || tm->tm_year > 2107) + return 0; + msdos_year = tm->tm_year + 1900 - 1980; /* tm_mon + 1 because MS uses 1-12 for months, and struct tm uses 0-11 */ |
