From: Karel Zak Date: Mon, 17 Jun 2013 16:08:01 +0000 (+0200) Subject: cal: fix -y output for UTF8 X-Git-Tag: 7-start~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2e6a8e828bb493def8f2d155cd6aea4c5c81808;p=thirdparty%2Futil-linux.git 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 --- 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);