apply utils::strdup() in a few more cases

This commit is contained in:
Axel Kohlmeyer
2021-02-04 17:52:32 -05:00
parent 5c8bbb42f6
commit cf427bcad8
14 changed files with 83 additions and 159 deletions

View File

@ -13,13 +13,12 @@
#include "fix_property_atom.h"
#include <cstring>
#include "atom.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
#include "memory.h"
#include <cstring>
using namespace LAMMPS_NS;
using namespace FixConst;
@ -126,9 +125,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
// store current atom style
int n = strlen(atom->atom_style) + 1;
astyle = new char[n];
strcpy(astyle,atom->atom_style);
astyle = utils::strdup(atom->atom_style);
// perform initial allocation of atom-based array
// register with Atom class