avoid 32-bit integer overflow by reordering

This commit is contained in:
Axel Kohlmeyer
2024-12-27 11:35:28 -05:00
parent f71fa8e94e
commit 9241f89582
4 changed files with 13 additions and 13 deletions

View File

@ -409,8 +409,8 @@ void Dump::write()
int nlocal = atom->nlocal;
if (nlocal > maxpbc) pbc_allocate();
if (nlocal) {
memcpy(&xpbc[0][0],&atom->x[0][0],(3*nlocal*sizeof(double))&MEMCPYMASK);
memcpy(&vpbc[0][0],&atom->v[0][0],(3*nlocal*sizeof(double))&MEMCPYMASK);
memcpy(&xpbc[0][0],&atom->x[0][0],(sizeof(double)*3*nlocal)&MEMCPYMASK);
memcpy(&vpbc[0][0],&atom->v[0][0],(sizeof(double)*3*nlocal)&MEMCPYMASK);
memcpy(imagepbc,atom->image,(nlocal*sizeof(imageint))&MEMCPYMASK);
}
xhold = atom->x;