correct compute argument count check, avoid segfault
This commit is contained in:
@ -41,7 +41,7 @@ Compute::Compute(LAMMPS *lmp, int narg, char **arg) :
|
||||
{
|
||||
instance_me = instance_total++;
|
||||
|
||||
if (narg < 3) error->all(FLERR,"Illegal compute command");
|
||||
if (narg < 3) utils::missing_cmd_args(FLERR,"compute", error);
|
||||
|
||||
// compute ID, group, and style
|
||||
// ID must be all alphanumeric chars or underscores
|
||||
|
||||
@ -27,7 +27,7 @@ using namespace LAMMPS_NS;
|
||||
ComputeVACF::ComputeVACF(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg), id_fix(nullptr)
|
||||
{
|
||||
if (narg > 2) error->all(FLERR, 3, "Compute vacf does not accept any arguments");
|
||||
if (narg > 3) error->all(FLERR, 3, "Compute vacf does not accept any arguments");
|
||||
|
||||
vector_flag = 1;
|
||||
size_vector = 4;
|
||||
|
||||
Reference in New Issue
Block a user