From a2e6a8e828bb493def8f2d155cd6aea4c5c81808 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 17 Jun 2013 18:08:01 +0200 Subject: [PATCH] cal: fix -y output for UTF8 ... in the yearly() function is a static buffer where is not space for multibyte headers. Signed-off-by: Karel Zak --- misc-utils/cal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc-utils/cal.c b/misc-utils/cal.c index 276148db63..1eeeea8a0a 100644 --- a/misc-utils/cal.c +++ b/misc-utils/cal.c @@ -598,7 +598,10 @@ void yearly(int day, int year) { int col, *dp, i, month, row, which_cal; int days[12][MAXDAYS]; - char *p, lineout[100]; + char *p; + char lineout[ sizeof(day_headings) + 2 + + sizeof(day_headings) + 2 + + sizeof(day_headings) + 1 ]; snprintf(lineout, sizeof(lineout), "%d", year); center(lineout, WEEK_LEN*3 + HEAD_SEP*2 - 1, 0); -- 2.47.3