simplify by using utils::strdup()

This commit is contained in:
Axel Kohlmeyer
2021-03-18 19:58:04 -04:00
parent c5ab2becd7
commit 59c0325f08
29 changed files with 53 additions and 135 deletions

View File

@ -43,17 +43,9 @@ ComputeHeatFlux::ComputeHeatFlux(LAMMPS *lmp, int narg, char **arg) :
// store ke/atom, pe/atom, stress/atom IDs used by heat flux computation
// insure they are valid for these computations
int n = strlen(arg[3]) + 1;
id_ke = new char[n];
strcpy(id_ke,arg[3]);
n = strlen(arg[4]) + 1;
id_pe = new char[n];
strcpy(id_pe,arg[4]);
n = strlen(arg[5]) + 1;
id_stress = new char[n];
strcpy(id_stress,arg[5]);
id_ke = utils::strdup(arg[3]);
id_pe = utils::strdup(arg[4]);
id_stress = utils::strdup(arg[5]);
int ike = modify->find_compute(id_ke);
int ipe = modify->find_compute(id_pe);