aboutsummaryrefslogtreecommitdiff
path: root/proto.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto.c')
-rw-r--r--proto.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/proto.c b/proto.c
index acbc251..5f1c03e 100644
--- a/proto.c
+++ b/proto.c
@@ -21,6 +21,8 @@ static int isleap(int year)
static int mdays(int year, int month)
{
+ if (month < 1 || month > 12)
+ return 0;
return (isleap(year) && month == 2) ? 29 : days[month - 1];
}