make more use of std::string and fmtlib where beneficial

This commit is contained in:
Axel Kohlmeyer
2020-06-25 21:13:14 -04:00
parent 8caa3e188c
commit 3c78ad0a70
7 changed files with 46 additions and 68 deletions

View File

@ -20,6 +20,7 @@
#include "comm.h"
#include "force.h"
#include "error.h"
#include "fmt/format.h"
using namespace LAMMPS_NS;
@ -58,11 +59,9 @@ void DumpMovie::openfile()
fp = popen(moviecmd,"w");
#endif
if (fp == NULL) {
char str[128];
sprintf(str,"Failed to open FFmpeg pipeline to file %s",filename);
error->one(FLERR,str);
}
if (fp == NULL)
error->one(FLERR,fmt::format("Failed to open FFmpeg pipeline to "
"file {}",filename));
}
}
/* ---------------------------------------------------------------------- */