Convert sprintf to snprintf in most files

This commit is contained in:
Nimish Telang
2023-04-17 15:39:34 +00:00
committed by Seth Hillbrand
parent d0676118c1
commit 51e55dd750
15 changed files with 149 additions and 181 deletions
+3 -1
View File
@@ -28,6 +28,7 @@
*/
#include <algorithm>
#include <cstdio> // snprintf
#include <wx/filename.h>
#include <wx/mstream.h>
@@ -93,11 +94,12 @@ std::string PDF_PLOTTER::encodeStringForPlotter( const wxString& aText )
{
result = "<FEFF";
for( size_t ii = 0; ii < aText.Len(); ii++ )
{
unsigned int code = aText[ii];
char buffer[16];
sprintf( buffer, "%4.4X", code );
std::snprintf( buffer, sizeof( buffer ), "%4.4X", code );
result += buffer;
}