Change sprintf to snprintf
cal.c:40: warning: sprintf() is often misused, please use snprintf()
This commit is contained in:
parent
0fcb939408
commit
af4af8a0d8
2
cal.c
2
cal.c
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user