use utils::strdup() for duplicating strings

This commit is contained in:
Axel Kohlmeyer
2021-03-15 15:31:25 -04:00
parent a6a2879807
commit ece2433208
6 changed files with 21 additions and 54 deletions

View File

@ -20,9 +20,7 @@ using namespace LAMMPS_NS;
Body::Body(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp)
{
int n = strlen(arg[0]) + 1;
style = new char[n];
strcpy(style,arg[0]);
style = utils::strdup(arg[0]);
icp = nullptr;
dcp = nullptr;
}