From dd44189d1ff3947f67e006b80dcd39b9b629ff04 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer <akohlmey@gmail.com> Date: Sat, 10 Jun 2017 04:35:11 -0400 Subject: [PATCH] fix bug in compute orientorder/atom argument parsing --- src/compute_orientorder_atom.cpp | 33 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/compute_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index 43f13ecc32..90e2830e39 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -102,23 +102,22 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg if (qlist[iw] > qmax) qmax = qlist[iw]; } iarg += nqlist; - if (strcmp(arg[iarg],"components") == 0) { - qlcompflag = 1; - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute orientorder/atom command"); - qlcomp = force->numeric(FLERR,arg[iarg+1]); - if (qlcomp <= 0) - error->all(FLERR,"Illegal compute orientorder/atom command"); - iqlcomp = -1; - for (int iw = 0; iw < nqlist; iw++) - if (qlcomp == qlist[iw]) { - iqlcomp = iw; - break; - } - if (iqlcomp < 0) - error->all(FLERR,"Illegal compute orientorder/atom command"); - iarg += 2; - } + } else if (strcmp(arg[iarg],"components") == 0) { + qlcompflag = 1; + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute orientorder/atom command"); + qlcomp = force->numeric(FLERR,arg[iarg+1]); + if (qlcomp <= 0) + error->all(FLERR,"Illegal compute orientorder/atom command"); + iqlcomp = -1; + for (int iw = 0; iw < nqlist; iw++) + if (qlcomp == qlist[iw]) { + iqlcomp = iw; + break; + } + if (iqlcomp < 0) + error->all(FLERR,"Illegal compute orientorder/atom command"); + iarg += 2; } else if (strcmp(arg[iarg],"cutoff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute orientorder/atom command"); -- GitLab