From 526c10436caa894fb6139f4e6c0f73eebfa858ea Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 21 Dec 2020 20:52:51 -0800 Subject: [clang-tidy] Fix bad widening casts Found with bugprone-misplaced-widening-cast Signed-off-by: Rosen Penev --- src/time64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/time64.c b/src/time64.c index 53932de..07639df 100644 --- a/src/time64.c +++ b/src/time64.c @@ -531,7 +531,7 @@ Time64_T mktime64(struct TM *input_date) { /* Correct the user's possibly out of bound input date */ copy_tm_to_TM64(&safe_date, input_date); - timev += seconds_between_years(year, (Year)(safe_date.tm_year + 1900)); + timev += seconds_between_years(year, (Year)(safe_date.tm_year) + 1900); return timev; } @@ -706,7 +706,7 @@ struct TM *localtime64_r (const Time64_T *timev, struct TM *local_tm) ) { TIME64_TRACE1("Mapping tm_year %lld to safe_year\n", (Year)gm_tm.tm_year); - gm_tm.tm_year = safe_year((Year)(gm_tm.tm_year + 1900)) - 1900; + gm_tm.tm_year = safe_year((Year)(gm_tm.tm_year) + 1900) - 1900; } safe_time = (time_t)timegm64(&gm_tm); -- cgit v1.1-32-gdbae