get rid of local buffers and snprinf()

This commit is contained in:
Axel Kohlmeyer
2020-06-04 16:25:09 -04:00
parent 4b58e33b1e
commit 62ee8d41f3
8 changed files with 76 additions and 124 deletions

View File

@ -26,6 +26,7 @@
#include "memory.h"
#include "error.h"
#include "utils.h"
#include "fmt/format.h"
using namespace LAMMPS_NS;
@ -1721,11 +1722,8 @@ void Molecule::deallocate()
void Molecule::open(char *file)
{
fp = fopen(file,"r");
if (fp == NULL) {
char str[128];
snprintf(str,128,"Cannot open molecule file %s",file);
error->one(FLERR,str);
}
if (fp == NULL)
error->one(FLERR,fmt::format("Cannot open molecule file {}",file));
}
/* ----------------------------------------------------------------------