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

@ -33,9 +33,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) :
options(narg-6,&arg[6]);
if (utils::strmatch(arg[2],"^v_")) {
int n = strlen(arg[2]+2) + 1;
xstr = new char[n];
strcpy(xstr,arg[2]+2);
xstr = utils::strdup(arg[2]+2);
xc = 0.0;
xstyle = VARIABLE;
varshape = 1;
@ -45,9 +43,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) :
}
if (utils::strmatch(arg[3],"^v_")) {
int n = strlen(arg[3]+2) + 1;
ystr = new char[n];
strcpy(ystr,arg[3]+2);
ystr = utils::strdup(arg[3]+2);
yc = 0.0;
ystyle = VARIABLE;
varshape = 1;
@ -57,9 +53,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) :
}
if (utils::strmatch(arg[4],"^v_")) {
int n = strlen(arg[4]+2) + 1;
zstr = new char[n];
strcpy(zstr,arg[4]+2);
zstr = utils::strdup(arg[4]+2);
zc = 0.0;
zstyle = VARIABLE;
varshape = 1;
@ -69,9 +63,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) :
}
if (utils::strmatch(arg[5],"^v_")) {
int n = strlen(&arg[5][2]) + 1;
rstr = new char[n];
strcpy(rstr,&arg[5][2]);
rstr = utils::strdup(arg[5]+2);
radius = 0.0;
rstyle = VARIABLE;
varshape = 1;