use utils::strdup() for duplicating strings
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user