correct out-of-bounds accesses

This commit is contained in:
Axel Kohlmeyer 2017-01-14 17:06:23 -05:00
parent c31f1e9f22
commit 5821fe8dd5
1 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ FixSRP::FixSRP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
// zero
for (int i = 0; i < atom->nmax; i++)
for (int m = 0; m < 3; m++)
for (int m = 0; m < 2; m++)
array[i][m] = 0.0;
}
@ -170,7 +170,7 @@ void FixSRP::setup_pre_force(int zz)
xold[i][2] = x[i][2];
tagold[i]=tag[i];
dlist[i] = (type[i] == bptype) ? 1 : 0;
for (n = 0; n < 3; n++)
for (n = 0; n < 2; n++)
array[i][n] = 0.0;
}