diff options
author | 2018-08-13 00:39:57 -0400 | |
---|---|---|
committer | 2018-08-13 00:39:57 -0400 | |
commit | 3f1b9ba8e9cf2b3a0ef1f10d9537e031a2b21fca (patch) | |
tree | 107e428fa9c6b9cbef4791111e84611f8a326428 /src/lib/util/timeconv.h | |
parent | 75ee814aaea79a0e79c14ead29ef448da3b4e85e (diff) |
imgtool: fix off by one error with leap years (nw)
Diffstat (limited to 'src/lib/util/timeconv.h')
-rw-r--r-- | src/lib/util/timeconv.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/util/timeconv.h b/src/lib/util/timeconv.h index 365af8c19fb..b24705e5867 100644 --- a/src/lib/util/timeconv.h +++ b/src/lib/util/timeconv.h @@ -240,7 +240,7 @@ private: duration -= century_count * century; const int four_years_count = std::min(int(duration / four_years), 25); duration -= four_years_count * four_years; - const int year_count = int(duration / year); + const int year_count = std::min(int(duration / year), 3); duration -= year_count * year; const int actual_year = tm_conversion_clock::base_year + four_centuries_count * 400 + century_count * 100 + four_years_count * 4 + year_count; |