Replace various sprintf calls with snprintf calls

This commit is contained in:
Tim Angus committed 2025-07-13 13:29:50 +01:00
1 parent ab18167a09
commit aea99aa3a3
4 files changed
+9 -9

No files matched your search

+2 -2
View File
@@ -546,7 +546,7 @@ static void DefineSymbol( char *sym, int value ) {
// add the file prefix to local symbols to guarantee unique
if ( sym[0] == '$' ) {
sprintf( expanded, "%s_%i", sym, currentFileIndex );
snprintf( expanded, sizeof(expanded), "%s_%i", sym, currentFileIndex );
sym = expanded;
}
@@ -602,7 +602,7 @@ static int LookupSymbol( char *sym ) {
// add the file prefix to local symbols to guarantee unique
if ( sym[0] == '$' ) {
sprintf( expanded, "%s_%i", sym, currentFileIndex );
snprintf( expanded, sizeof(expanded), "%s_%i", sym, currentFileIndex );
sym = expanded;
}