1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

time: fix error: array index out of range

This commit is contained in:
sh0f 2020-01-01 14:27:48 +08:00 committed by Alexander Medvednikov
parent abe4898b4a
commit a99f214a0f

View File

@ -88,6 +88,9 @@ fn calculate_date_from_offset(day_offset_ int) (int, int, int) {
estimated_month++
}
for day_offset <= days_before[estimated_month] {
if estimated_month == 0 {
break
}
estimated_month--
}