Message ID | 20191104095923.116086-3-gitter.spiros@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | None | expand |
diff --git a/date.c b/date.c index 041db7db4e..b8dcbdbb0e 100644 --- a/date.c +++ b/date.c @@ -1172,7 +1172,7 @@ static const char *approxidate_alpha(const char *date, struct tm *tm, struct tm while (tl->type) { int len = strlen(tl->type); if (match_string(date, tl->type) >= len-1) { - update_tm(tm, now, tl->length * *num); + update_tm(tm, now, (time_t)tl->length * *num); *num = 0; *touched = 1; return end;
Fix the LGTM warning fired by the rule that finds code that could convert the result of an integer multiplication to a larger type. Since the conversion applies after the multiplication, arithmetic overflow may still occur. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> --- date.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)