diff options
author | Leah Neukirchen <leah@vuxu.org> | 2020-01-07 17:42:28 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2020-01-07 17:42:28 +0100 |
commit | e52db9dae7275c0325cd203fa7039a4a33bf5a7e (patch) | |
tree | a9fea5bd0317e1128a08ab84d68415f50be63899 /src/usr.bin/calendar | |
parent | 2a9d46ad206f7cb2f9d6acf0b01445851ea8b215 (diff) | |
download | outils-e52db9dae7275c0325cd203fa7039a4a33bf5a7e.tar.gz outils-e52db9dae7275c0325cd203fa7039a4a33bf5a7e.tar.xz outils-e52db9dae7275c0325cd203fa7039a4a33bf5a7e.zip |
cvs update v0.9
Diffstat (limited to 'src/usr.bin/calendar')
-rw-r--r-- | src/usr.bin/calendar/day.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/usr.bin/calendar/day.c b/src/usr.bin/calendar/day.c index c94a844..e271250 100644 --- a/src/usr.bin/calendar/day.c +++ b/src/usr.bin/calendar/day.c @@ -1,4 +1,4 @@ -/* $OpenBSD: day.c,v 1.36 2019/02/01 16:22:53 millert Exp $ */ +/* $OpenBSD: day.c,v 1.37 2019/08/12 20:03:28 millert Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -323,10 +323,12 @@ isnow(char *endp, int bodun) if (month == -1) { month = tp->tm_mon + 1; interval = MONTHLY; - } else if (calendar) - adjust_calendar(&day, &month); - if ((month > 12) || (month < 1)) - return (NULL); + } else { + if ((month > 12) || (month < 1)) + return (NULL); + if (calendar) + adjust_calendar(&day, &month); + } } /* 2. {Monthname} XYZ ... */ @@ -371,6 +373,8 @@ isnow(char *endp, int bodun) else { /* F_ISDAY set, v2 > 12, or no way to tell */ month = v1; + if ((month > 12) || (month < 1)) + return (NULL); /* if no recognizable day, assume the first */ day = v2 ? v2 : 1; if ((flags & F_ISDAY)) { |