replace a few more cases of atoi()/atof() with utils::*numeric() functions

This commit is contained in:
Axel Kohlmeyer
2021-02-21 15:09:50 -05:00
parent d5917652d4
commit 826c618aa9
4 changed files with 22 additions and 16 deletions

View File

@ -148,8 +148,8 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
if (iarg+3 > narg) error->all(FLERR,"Illegal compute reduce command");
if (mode != MINN && mode != MAXX)
error->all(FLERR,"Compute reduce replace requires min or max mode");
int col1 = atoi(arg[iarg+1]) - 1;
int col2 = atoi(arg[iarg+2]) - 1;
int col1 = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1;
int col2 = utils::inumeric(FLERR,arg[iarg+2],false,lmp) - 1;
if (col1 < 0 || col1 >= nvalues || col2 < 0 || col2 >= nvalues)
error->all(FLERR,"Illegal compute reduce command");
if (col1 == col2) error->all(FLERR,"Illegal compute reduce command");