mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-04 20:15:16 +00:00
Use strncpy instead of strcpy because again, buffer overflows
This commit is contained in:
parent
7769da9434
commit
79c34c68db
92 changed files with 298 additions and 279 deletions
|
|
@ -1303,7 +1303,7 @@ DefineEngineMethod( TerrainBlock, save, bool, ( const char* fileName),,
|
|||
"@return True if file save was successful, false otherwise")
|
||||
{
|
||||
char filename[256];
|
||||
dStrcpy(filename,fileName);
|
||||
dStrcpy(filename,fileName,256);
|
||||
char *ext = dStrrchr(filename, '.');
|
||||
if (!ext || dStricmp(ext, ".ter") != 0)
|
||||
dStrcat(filename, ".ter", 256);
|
||||
|
|
@ -1313,7 +1313,7 @@ DefineEngineMethod( TerrainBlock, save, bool, ( const char* fileName),,
|
|||
//ConsoleMethod(TerrainBlock, save, bool, 3, 3, "(string fileName) - saves the terrain block's terrain file to the specified file name.")
|
||||
//{
|
||||
// char filename[256];
|
||||
// dStrcpy(filename,argv[2]);
|
||||
// dStrcpy(filename,argv[2],256);
|
||||
// char *ext = dStrrchr(filename, '.');
|
||||
// if (!ext || dStricmp(ext, ".ter") != 0)
|
||||
// dStrcat(filename, ".ter", 256);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue