>From 7b1ebb6295aade41f4a0269ac473fff1dbc19bf3 Mon Sep 17 00:00:00 2001 From: sin <s...@2f30.org> Date: Fri, 19 Jul 2013 17:08:15 +0100 Subject: [PATCH] Change sprintf to snprintf
cal.c:40: warning: sprintf() is often misused, please use snprintf() --- cal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cal.c b/cal.c index f1ba10d..2c42ccd 100644 --- a/cal.c +++ b/cal.c @@ -37,7 +37,7 @@ drawcal(int year, int month, int day, int ncols, int nmons, int fday) cur = moff % 12; yoff = year + moff / 12; - sprintf(str, "%s %d", smon[cur], yoff); + snprintf(str, sizeof(str), "%s %d", smon[cur], yoff); printf("%-20s ", str); count[i] = 1; } -- 1.8.3.3