simplify using utils::strdup()
This commit is contained in:
@ -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");
|
||||
|
||||
Reference in New Issue
Block a user