mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
Replace remaining sprintfs with snprintf
This commit is contained in:
parent
f6839e58a1
commit
f5c4a29584
@ -708,7 +708,7 @@ void rarch_exec (void)
|
||||
spawn_data[i] = i & 0xff;
|
||||
|
||||
char spawn_data_size[16];
|
||||
sprintf(spawn_data_size, "%d", 256);
|
||||
snprintf(spawn_data_size, sizeof(spawn_data_size), "%d", 256);
|
||||
|
||||
const char * const spawn_argv[] = {
|
||||
spawn_data_size,
|
||||
|
@ -120,7 +120,7 @@ const char * path, const char * extensions)
|
||||
found_dir = true;
|
||||
|
||||
filebrowser->cur[filebrowser->file_count].d_type = found_dir ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRIBUTE_NORMAL;
|
||||
sprintf(filebrowser->cur[filebrowser->file_count].d_name, ffd.cFileName);
|
||||
snprintf(filebrowser->cur[filebrowser->file_count].d_name, sizeof(filebrowser->cur[filebrowser->file_count].d_name), ffd.cFileName);
|
||||
|
||||
filebrowser->file_count++;
|
||||
}while (FindNextFile(hFind, &ffd) != 0 && (filebrowser->file_count + 1) < MAX_FILE_LIMIT);
|
||||
|
@ -820,7 +820,7 @@ static void fillStructureItems(_CGNVCONTAINERS &containers, CgStructureType *str
|
||||
CgParameterEntry ¶meterArrayEntry = parameterEntries[size];
|
||||
|
||||
char buffer[256];
|
||||
sprintf(buffer,"%s[%i]",structuralElement->_name,k);
|
||||
snprintf(buffer, sizeof(buffer), "%s[%i]",structuralElement->_name,k);
|
||||
parameterArrayEntry.nameOffset = CNV2END((int)stringTableAddUnique(stringTable, buffer));
|
||||
parameterArrayEntry.flags = CNV2END(structuralElement->_flags);
|
||||
unsigned short structureFlag = CGP_STRUCTURE;
|
||||
|
@ -6902,12 +6902,12 @@ static bool cgGetElfProgramByIndex( CGELFBinary *elfBinary, int index, CGELFProg
|
||||
while ( true )
|
||||
{
|
||||
char sectionName[64];
|
||||
sprintf( sectionName, ".text%04i", index );
|
||||
snprintf( sectionName, sizeof(sectionName), ".text%04i", index );
|
||||
size_t texttabSize;
|
||||
const char *texttab = findSectionInPlace( elfBinary->elfFile, elfBinary->elfFileSize, sectionName, &texttabSize );
|
||||
if ( !texttab )
|
||||
break;
|
||||
sprintf( sectionName, ".paramtab%04i", index );
|
||||
snprintf( sectionName, sizeof(sectionName), ".paramtab%04i", index );
|
||||
size_t paramtabSize;
|
||||
const char *paramtab = findSectionInPlace( elfBinary->elfFile, elfBinary->elfFileSize, sectionName, ¶mtabSize );
|
||||
if ( !paramtab )
|
||||
|
Loading…
x
Reference in New Issue
Block a user