31
31
32
32
33
33
// C++ Includes
34
- #include <cstdio> // for std::sprintf
34
+ #include <cstdio> // for std::snprintf
35
35
#include <memory>
36
36
#include <numeric> // for std::partial_sum
37
37
#include <set>
@@ -1334,7 +1334,7 @@ void System::write_header (Xdr & io,
1334
1334
{
1335
1335
// set up the comment
1336
1336
comment = "# Name, Variable No. " ;
1337
- std ::sprintf (buf , "%u" , var );
1337
+ std ::snprintf (buf , 80 , "%u" , var );
1338
1338
comment += buf ;
1339
1339
comment += ", System \"" ;
1340
1340
comment += this -> name ();
@@ -1348,7 +1348,7 @@ void System::write_header (Xdr & io,
1348
1348
{
1349
1349
// set up the comment
1350
1350
comment = "# Subdomains, Variable \"" ;
1351
- std ::sprintf (buf , "%s" , this -> variable_name (var ).c_str ());
1351
+ std ::snprintf (buf , 80 , "%s" , this -> variable_name (var ).c_str ());
1352
1352
comment += buf ;
1353
1353
comment += "\", System \"" ;
1354
1354
comment += this -> name ();
@@ -1366,7 +1366,7 @@ void System::write_header (Xdr & io,
1366
1366
{
1367
1367
// set up the comment
1368
1368
comment = "# Approximation Order, Variable \"" ;
1369
- std ::sprintf (buf , "%s" , this -> variable_name (var ).c_str ());
1369
+ std ::snprintf (buf , 80 , "%s" , this -> variable_name (var ).c_str ());
1370
1370
comment += buf ;
1371
1371
comment += "\", System \"" ;
1372
1372
comment += this -> name ();
@@ -1382,7 +1382,7 @@ void System::write_header (Xdr & io,
1382
1382
// do the same for radial_order
1383
1383
{
1384
1384
comment = "# Radial Approximation Order, Variable \"" ;
1385
- std ::sprintf (buf , "%s" , this -> variable_name (var ).c_str ());
1385
+ std ::snprintf (buf , 80 , "%s" , this -> variable_name (var ).c_str ());
1386
1386
comment += buf ;
1387
1387
comment += "\", System \"" ;
1388
1388
comment += this -> name ();
@@ -1399,7 +1399,7 @@ void System::write_header (Xdr & io,
1399
1399
{
1400
1400
// set up the comment
1401
1401
comment = "# FE Family, Variable \"" ;
1402
- std ::sprintf (buf , "%s" , this -> variable_name (var ).c_str ());
1402
+ std ::snprintf (buf , 80 , "%s" , this -> variable_name (var ).c_str ());
1403
1403
comment += buf ;
1404
1404
comment += "\", System \"" ;
1405
1405
comment += this -> name ();
@@ -1412,7 +1412,7 @@ void System::write_header (Xdr & io,
1412
1412
#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1413
1413
1414
1414
comment = "# Radial FE Family, Variable \"" ;
1415
- std ::sprintf (buf , "%s" , this -> variable_name (var ).c_str ());
1415
+ std ::snprintf (buf , 80 , "%s" , this -> variable_name (var ).c_str ());
1416
1416
comment += buf ;
1417
1417
comment += "\", System \"" ;
1418
1418
comment += this -> name ();
@@ -1422,7 +1422,7 @@ void System::write_header (Xdr & io,
1422
1422
io .data (radial_fam , comment .c_str ());
1423
1423
1424
1424
comment = "# Infinite Mapping Type, Variable \"" ;
1425
- std ::sprintf (buf , "%s" , this -> variable_name (var ).c_str ());
1425
+ std ::snprintf (buf , 80 , "%s" , this -> variable_name (var ).c_str ());
1426
1426
comment += buf ;
1427
1427
comment += "\", System \"" ;
1428
1428
comment += this -> name ();
@@ -1457,7 +1457,7 @@ void System::write_header (Xdr & io,
1457
1457
// 9.)
1458
1458
// write the name of the cnt-th additional vector
1459
1459
comment = "# Name of " ;
1460
- std ::sprintf (buf , "%dth vector" , cnt ++ );
1460
+ std ::snprintf (buf , 80 , "%dth vector" , cnt ++ );
1461
1461
comment += buf ;
1462
1462
std ::string vec_name = pr .first ;
1463
1463
0 commit comments