avoid overflow when computing memory address offsets on 64-bit machines

This commit is contained in:
Axel Kohlmeyer
2021-02-05 19:42:07 -05:00
parent e223ea3784
commit 12f49c4c89
4 changed files with 12 additions and 12 deletions

View File

@ -167,8 +167,8 @@ void FixStore::write_restart(FILE *fp)
rbuf[0] = nrow;
rbuf[1] = ncol;
if (vecflag) memcpy(&rbuf[2],vstore,nrow*sizeof(double));
else memcpy(&rbuf[2],&astore[0][0],nrow*ncol*sizeof(double));
if (vecflag) memcpy(&rbuf[2],vstore,sizeof(double)*nrow);
else memcpy(&rbuf[2],&astore[0][0],sizeof(double)*nrow*ncol);
int n = nrow*ncol + 2;
if (comm->me == 0) {