Change sprintf to snprintf

cal.c:40: warning: sprintf() is often misused, please use snprintf()
This commit is contained in:
sin 2013-07-19 17:08:15 +01:00 committed by David Galos
parent 0fcb939408
commit af4af8a0d8

2
cal.c
View File

@ -37,7 +37,7 @@ drawcal(int year, int month, int day, int ncols, int nmons, int fday)
cur = moff % 12; cur = moff % 12;
yoff = year + 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); printf("%-20s ", str);
count[i] = 1; count[i] = 1;
} }