remove local buffers and snprintf() for file open error messages.

This commit is contained in:
Axel Kohlmeyer
2020-06-04 13:30:44 -04:00
parent 47888b587a
commit 2777d37a61
8 changed files with 44 additions and 55 deletions

View File

@ -19,6 +19,7 @@
#include "modify.h"
#include "respa.h"
#include "error.h"
#include "fmt/format.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -76,11 +77,9 @@ void FixEnforce2D::init()
if (modify->fix[i]->enforce2d_flag) {
if (myindex < 0)
flist[nfixlist++] = modify->fix[i];
else {
char msg[256];
snprintf(msg,256,"Fix enforce2d must be defined after fix %s",modify->fix[i]->style);
error->all(FLERR,msg);
}
else
error->all(FLERR,fmt::format("Fix enforce2d must be defined after fix {}",
modify->fix[i]->style));
}
if (modify->fix[i] == this) myindex = i;
}