aboutsummaryrefslogtreecommitdiff
path: root/src/alf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alf.c')
-rw-r--r--src/alf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/alf.c b/src/alf.c
index 82c9432..d0490ab 100644
--- a/src/alf.c
+++ b/src/alf.c
@@ -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 */