for (joystick = 0; joystick < joystickInfo.size(); ++joystick)\r
{\r
char logString[256];\r
- (void)sprintf(logString, "Found joystick %u, %u axes, %u buttons '%s'",\r
+ snprintf_irr(logString, sizeof(logString), "Found joystick %d, %d axes, %d buttons '%s'",\r
joystick, joystickInfo[joystick].Axes,\r
joystickInfo[joystick].Buttons, joystickInfo[joystick].Name.c_str());\r
os::Printer::log(logString, ELL_INFORMATION);\r
for(joystick = 0; joystick < (int)joystickInfo.size(); ++joystick)\r
{\r
char logString[256];\r
- (void)sprintf(logString, "Found joystick %d, %d axes, %d buttons '%s'",\r
- joystick, joystickInfo[joystick].Axes,\r
- joystickInfo[joystick].Buttons, joystickInfo[joystick].Name.c_str());\r
+ snprintf_irr(logString, sizeof(logString), "Found joystick %d, %d axes, %d buttons '%s'",\r
+ joystick, joystickInfo[joystick].Axes,\r
+ joystickInfo[joystick].Buttons, joystickInfo[joystick].Name.c_str());\r
os::Printer::log(logString, ELL_INFORMATION);\r
}\r
\r
for(joystick = 0; joystick < joystickInfo.size(); ++joystick)\r
{\r
char logString[256];\r
- (void)sprintf(logString, "Found joystick %d, %d axes, %d buttons '%s'",\r
+ snprintf_irr(logString, sizeof(logString), "Found joystick %d, %d axes, %d buttons '%s'",\r
joystick, joystickInfo[joystick].Axes,\r
joystickInfo[joystick].Buttons, joystickInfo[joystick].Name.c_str());\r
os::Printer::log(logString, ELL_INFORMATION);\r
\r
if (r.right < 2 || r.bottom < 2)\r
{\r
- sprintf(tmp, "Ignoring resize operation to (%ld %ld)", r.right, r.bottom);\r
+ snprintf_irr(tmp, sizeof(tmp), "Ignoring resize operation to (%ld %ld)", r.right, r.bottom);\r
os::Printer::log(tmp);\r
}\r
else\r
{\r
- sprintf(tmp, "Resizing window (%ld %ld)", r.right, r.bottom);\r
+ snprintf_irr(tmp, sizeof(tmp), "Resizing window (%ld %ld)", r.right, r.bottom);\r
os::Printer::log(tmp);\r
\r
getVideoDriver()->OnResize(irr::core::dimension2du((u32)r.right, (u32)r.bottom));\r
\r
if (prmCount > m)\r
{\r
- char tmp[1024];\r
- sprintf(tmp,"Could not draw triangles, too many primitives(%u), maximum is %u.", prmCount, m);\r
+ char tmp[128];\r
+ snprintf_irr(tmp, sizeof(tmp), "Could not draw triangles, too many primitives(%u), maximum is %u.", prmCount, m);\r
os::Printer::log(tmp, ELL_ERROR);\r
return false;\r
}\r
{\r
if ( data.getCallsCounter() > 0 )\r
{\r
-#ifdef _MSC_VER\r
-#pragma warning(disable:4996) // 'sprintf' was declared deprecated\r
-#endif\r
- // Can't use swprintf as it fails on some platforms (especially mobile platforms)\r
- // Can't use Irrlicht functions because we have no string formatting.\r
- char dummy[1023];\r
- sprintf(dummy, "%-15.15s%-12u%-12u%-12u%-12u",\r
- core::stringc(data.getName()).c_str(), data.getCallsCounter(), data.getTimeSum(),\r
+ wchar_t dummy[512];\r
+ swprintf_irr(dummy, 512, L"%-15.15s%-12u%-12u%-12u%-12u",\r
+ data.getName().c_str(), data.getCallsCounter(), data.getTimeSum(),\r
data.getTimeSum() / data.getCallsCounter(), data.getLongestTime());\r
- dummy[1022] = 0;\r
\r
return core::stringw(dummy);\r
-#ifdef _MSC_VER\r
-#pragma warning(default :4996) // 'sprintf' was declared deprecated\r
-#endif\r
}\r
else\r
{\r
//99 - AES encryption, WinZip 9\r
\r
const SZipFileEntry &e = FileInfo[Files[index].ID];\r
- wchar_t buf[64];\r
+ char buf[64];\r
s16 actualCompressionMethod=e.header.CompressionMethod;\r
IReadFile* decrypted=0;\r
u8* decryptedBuf=0;\r
c8* pBuf = new c8[ uncompressedSize ];\r
if (!pBuf)\r
{\r
- swprintf_irr ( buf, 64, L"Not enough memory for decompressing %s", core::stringw(Files[index].FullName).c_str() );\r
+ snprintf_irr ( buf, 64, "Not enough memory for decompressing %s", Files[index].FullName.c_str() );\r
os::Printer::log( buf, ELL_ERROR);\r
if (decrypted)\r
decrypted->drop();\r
pcData = new u8[decryptedSize];\r
if (!pcData)\r
{\r
- swprintf_irr ( buf, 64, L"Not enough memory for decompressing %s", core::stringw(Files[index].FullName).c_str() );\r
+ snprintf_irr ( buf, 64, "Not enough memory for decompressing %s", Files[index].FullName.c_str() );\r
os::Printer::log( buf, ELL_ERROR);\r
delete [] pBuf;\r
return 0;\r
\r
if (err != Z_OK)\r
{\r
- swprintf_irr ( buf, 64, L"Error decompressing %s", core::stringw(Files[index].FullName).c_str() );\r
+ snprintf_irr ( buf, 64, "Error decompressing %s", Files[index].FullName.c_str() );\r
os::Printer::log( buf, ELL_ERROR);\r
delete [] pBuf;\r
return 0;\r
os::Printer::log("Decryption support not enabled. File cannot be read.", ELL_ERROR);\r
return 0;\r
default:\r
- swprintf_irr ( buf, 64, L"file has unsupported compression method. %s", core::stringw(Files[index].FullName).c_str() );\r
+ snprintf_irr ( buf, 64, "file has unsupported compression method. %s", Files[index].FullName.c_str() );\r
os::Printer::log( buf, ELL_ERROR);\r
return 0;\r
};\r