From 7586e9d1aa3d054efc0a4c959c41be98660072b0 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 3 Jul 2020 13:17:51 +0200 Subject: [PATCH] cal: use size_t to calculate width [lgtm scan] We use size_t for width. This patch makes it consistent for years_width too. Signed-off-by: Karel Zak --- misc-utils/cal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc-utils/cal.c b/misc-utils/cal.c index d2d68162a0..0834be2bd5 100644 --- a/misc-utils/cal.c +++ b/misc-utils/cal.c @@ -1057,10 +1057,10 @@ static void monthly(const struct cal_control *ctl) static void yearly(const struct cal_control *ctl) { char out[FMT_ST_CHARS]; - int year_width; + size_t year_width; - year_width = ctl->months_in_row * (ctl->week_width) + - (ctl->months_in_row - 1) * ctl->gutter_width; + year_width = (size_t) ctl->months_in_row * ctl->week_width + + ((size_t) ctl->months_in_row - 1) * ctl->gutter_width; if (ctl->header_year) { snprintf(out, sizeof(out), "%04d", ctl->req.year); -- 2.47.3