aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/newsyslog/ptimes.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/newsyslog/ptimes.c b/usr.sbin/newsyslog/ptimes.c
index b7b993f01959..d54ca1d40050 100644
--- a/usr.sbin/newsyslog/ptimes.c
+++ b/usr.sbin/newsyslog/ptimes.c
@@ -279,6 +279,10 @@ parseDWM(struct ptime_data *ptime, const char *s)
if (tm.tm_mday > daysmon) {
tm.tm_mon++;
tm.tm_mday = tm.tm_mday - daysmon;
+ if (tm.tm_mon >= 12) {
+ tm.tm_mon = 0;
+ tm.tm_year++;
+ }
}
}
break;