fix some issues flagged by coverity scan

This commit is contained in:
Axel Kohlmeyer
2025-01-14 22:23:24 -05:00
parent 5f50278241
commit 2cbdaf8a6a
4 changed files with 10 additions and 13 deletions

View File

@ -581,9 +581,8 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) :
msglen += 3*4*num_coords+IMDHEADERSIZE;
}
msgdata = new char[msglen];
}
else {
msglen = 3*sizeof(float)*num_coords+IMDHEADERSIZE;
} else {
msglen = 3*(int)sizeof(float)*num_coords+IMDHEADERSIZE;
msgdata = new char[msglen];
}