simplify using utils::strdup()

This commit is contained in:
Axel Kohlmeyer
2021-03-18 20:56:04 -04:00
parent 1710fb86d3
commit a5563e8d04
18 changed files with 47 additions and 135 deletions

View File

@ -49,13 +49,8 @@ FixSpringChunk::FixSpringChunk(LAMMPS *lmp, int narg, char **arg) :
k_spring = utils::numeric(FLERR,arg[3],false,lmp);
int n = strlen(arg[4]) + 1;
idchunk = new char[n];
strcpy(idchunk,arg[4]);
n = strlen(arg[5]) + 1;
idcom = new char[n];
strcpy(idcom,arg[5]);
idchunk = utils::strdup(arg[4]);
idcom = utils::strdup(arg[5]);
esprings = 0.0;
nchunk = 0;