simplify by using utils::strdup()
This commit is contained in:
@ -51,9 +51,7 @@ ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr;
|
||||
else {
|
||||
int n = strlen(arg[3]) + 1;
|
||||
id_temp = new char[n];
|
||||
strcpy(id_temp,arg[3]);
|
||||
id_temp = utils::strdup(arg[3]);
|
||||
|
||||
int icompute = modify->find_compute(id_temp);
|
||||
if (icompute < 0)
|
||||
|
||||
Reference in New Issue
Block a user