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

@ -70,9 +70,7 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
if (narg != 10) error->all(FLERR,"Illegal fix spring command");
styleflag = COUPLE;
int n = strlen(arg[4]) + 1;
group2 = new char[n];
strcpy(group2,arg[4]);
group2 = utils::strdup(arg[4]);
igroup2 = group->find(arg[4]);
if (igroup2 == -1)
error->all(FLERR,"Fix spring couple group ID does not exist");