Use snprintf() instead of sprintf() (#5907)

This commit is contained in:
Flössie
2020-09-15 14:56:57 +02:00
parent 49937a589f
commit 79278875da
18 changed files with 117 additions and 101 deletions

View File

@@ -124,7 +124,7 @@ static FILE* _printSetupTxt(
}
/* Construct feature format */
sprintf(format, "(%s,%s)=%%%dd ", fmt, fmt, val_width);
snprintf(format, sizeof(format), "(%s,%s)=%%%dd ", fmt, fmt, val_width);
return fp;
}
@@ -163,7 +163,7 @@ static void _printInteger(
int width)
{
char fmt[80];
sprintf(fmt, "%%%dd", width);
snprintf(fmt, sizeof(fmt), "%%%dd", width);
fprintf(fp, fmt, integer);
}