fix off-by-one memory allocation bug

This commit is contained in:
Axel Kohlmeyer
2017-07-13 10:55:13 -04:00
parent 0af9203fdc
commit de8d417aec

View File

@ -157,7 +157,7 @@ FixNPHugOMP::FixNPHugOMP(LAMMPS *lmp, int narg, char **arg) :
// create a new compute potential energy compute
n = strlen(id) + 3;
n = strlen(id) + 4;
id_pe = new char[n];
strcpy(id_pe,id);
strcat(id_pe,"_pe");