address argument indexing bug reported by stan

This commit is contained in:
Axel Kohlmeyer
2021-02-05 13:56:47 -05:00
parent 47783aaa9c
commit ba8f7bf3d8

View File

@ -152,17 +152,15 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
ids[i] = nullptr;
} else {
ArgInfo argi(arg[iarg]);
ArgInfo argi(arg[i]);
if (argi.get_type() == ArgInfo::NONE) break;
if ((argi.get_type() == ArgInfo::UNKNOWN) || (argi.get_dim() > 1))
error->all(FLERR,"Invalid fix ave/histo command");
which[nvalues] = argi.get_type();
argindex[nvalues] = argi.get_index1();
ids[nvalues] = argi.copy_name();
nvalues++;
which[i] = argi.get_type();
argindex[i] = argi.get_index1();
ids[i] = argi.copy_name();
}
}