make use of utils::strdup() and simplify

This commit is contained in:
Axel Kohlmeyer
2021-03-16 01:15:32 -04:00
parent 3d67d1eee9
commit 2f8770971c
3 changed files with 23 additions and 52 deletions

View File

@ -301,9 +301,7 @@ void Update::set_units(const char *style)
} else error->all(FLERR,"Illegal units command");
delete [] unit_style;
int n = strlen(style) + 1;
unit_style = new char[n];
strcpy(unit_style,style);
unit_style = utils::strdup(style);
// check if timestep was changed from default value
if (!dt_default && (comm->me == 0)) {