simplify some more code by using utils::strdup()

This commit is contained in:
Axel Kohlmeyer
2021-03-17 00:10:01 -04:00
parent a76a8eae59
commit 2dc0b70575
4 changed files with 12 additions and 33 deletions

View File

@ -40,10 +40,7 @@ ImbalanceVar::~ImbalanceVar()
int ImbalanceVar::options(int narg, char **arg)
{
if (narg < 1) error->all(FLERR,"Illegal balance weight command");
int len = strlen(arg[0]) + 1;
name = new char[len];
memcpy(name,arg[0],len);
name = utils::strdup(arg[0]);
init(0);
return 1;