avoid sprintf
This commit is contained in:
@ -1598,14 +1598,9 @@ void MinHFTN::open_hftn_print_file_()
|
||||
int nMyRank;
|
||||
MPI_Comm_rank (world, &nMyRank);
|
||||
|
||||
char szTmp[50];
|
||||
sprintf (szTmp, "progress_MinHFTN_%d.txt", nMyRank);
|
||||
_fpPrint = fopen (szTmp, "w");
|
||||
if (_fpPrint == nullptr) {
|
||||
printf ("*** MinHFTN cannot open file '%s'\n", szTmp);
|
||||
printf ("*** continuing...\n");
|
||||
return;
|
||||
}
|
||||
auto szTmp = fmt::format("progress_MinHFTN_{}.txt", nMyRank);
|
||||
_fpPrint = fopen (szTmp.c_str(), "w");
|
||||
if (_fpPrint == nullptr) return;
|
||||
|
||||
fprintf (_fpPrint, " Iter Evals Energy |F|_2"
|
||||
" Step TR used |step|_2 ared pred\n");
|
||||
|
||||
Reference in New Issue
Block a user