From ba8f7bf3d88f1e3777fffe1d8baa8bd7ff5c3c57 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 13:56:47 -0500 Subject: [PATCH] address argument indexing bug reported by stan --- src/fix_ave_histo.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index cad509e165..0d82fd6b04 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -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(); } }