Get rid of all sprintf calls

This commit is contained in:
sfan5
2022-02-26 11:18:19 +01:00
parent 00dd274510
commit 95af6d7c08
6 changed files with 17 additions and 26 deletions

View File

@ -448,7 +448,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
//99 - AES encryption, WinZip 9
const SZipFileEntry &e = FileInfo[Files[index].ID];
wchar_t buf[64];
char buf[64];
s16 actualCompressionMethod=e.header.CompressionMethod;
IReadFile* decrypted=0;
u8* decryptedBuf=0;
@ -470,7 +470,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
c8* pBuf = new c8[ uncompressedSize ];
if (!pBuf)
{
swprintf_irr ( buf, 64, L"Not enough memory for decompressing %s", core::stringw(Files[index].FullName).c_str() );
snprintf_irr ( buf, 64, "Not enough memory for decompressing %s", Files[index].FullName.c_str() );
os::Printer::log( buf, ELL_ERROR);
if (decrypted)
decrypted->drop();
@ -483,7 +483,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
pcData = new u8[decryptedSize];
if (!pcData)
{
swprintf_irr ( buf, 64, L"Not enough memory for decompressing %s", core::stringw(Files[index].FullName).c_str() );
snprintf_irr ( buf, 64, "Not enough memory for decompressing %s", Files[index].FullName.c_str() );
os::Printer::log( buf, ELL_ERROR);
delete [] pBuf;
return 0;
@ -524,7 +524,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
if (err != Z_OK)
{
swprintf_irr ( buf, 64, L"Error decompressing %s", core::stringw(Files[index].FullName).c_str() );
snprintf_irr ( buf, 64, "Error decompressing %s", Files[index].FullName.c_str() );
os::Printer::log( buf, ELL_ERROR);
delete [] pBuf;
return 0;
@ -551,7 +551,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
os::Printer::log("Decryption support not enabled. File cannot be read.", ELL_ERROR);
return 0;
default:
swprintf_irr ( buf, 64, L"file has unsupported compression method. %s", core::stringw(Files[index].FullName).c_str() );
snprintf_irr ( buf, 64, "file has unsupported compression method. %s", Files[index].FullName.c_str() );
os::Printer::log( buf, ELL_ERROR);
return 0;
};