Replace sprintf call with snprintf

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
Alan Coopersmith
2015-01-17 18:36:07 -08:00
parent 0037a42107
commit a5221fc113

View File

@@ -833,8 +833,8 @@ FontEncReallyReallyLoad(const char *charset,
encoding = NULL;
if (!format[0]) {
sprintf(format, "%%%ds %%%d[^\n]\n", (int)sizeof(encoding_name) - 1,
(int)sizeof(file_name) - 1);
snprintf(format, sizeof(format), "%%%ds %%%d[^\n]\n",
(int)sizeof(encoding_name) - 1, (int)sizeof(file_name) - 1);
}
for(;;) {
count = fscanf(file, format, encoding_name, file_name);