must advance buffer while package bonus items, but only when a buffer is given

This commit is contained in:
Axel Kohlmeyer 2020-07-14 12:45:22 -04:00
parent b33974cd19
commit bc3860b462
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 3 additions and 1 deletions

View File

@ -596,7 +596,9 @@ int AtomVecBody::pack_data_bonus(double *buf, int /*flag*/)
int m = 0;
for (i = 0; i < nlocal; i++) {
if (body[i] < 0) continue;
m += bptr->pack_data_body(tag[i],body[i],buf);
int n = bptr->pack_data_body(tag[i],body[i],buf);
m += n;
if (buf) buf += n;
}
return m;