continue;
if (buf[0] == '\n')
break;
- if (sscanf(buf, "%lf %lf %f", &dbuf[0], &dbuf[1], &dbuf[2]) < 3) {
+ if (sscanf(buf, "%lf %lf %lf", &dbuf[0], &dbuf[1], &dbuf[2]) < 3) {
snprintf(errbuf, errbufsize, "line %d: bad frame_periodic_box format", lineNumber);
goto exit;
}
} else {
free(mp->frame_cells);
mp->frame_cells = NULL;
+ mp->nframe_cells = 0;
}
} else {
if (i < mp->natoms)
ap->frames = (Vector *)realloc(ap->frames, sizeof(Vector) * s);
else {
AssignArray(&mp->frame_cells, &mp->nframe_cells, sizeof(Vector) * 4, s - 1, NULL);
+ mp->nframe_cells = s;
}
}
}
if (nn > 0)
MolActionCreateAndPerform(mol, gMolActionSetAtomPositions, ig, n, vp);
free(vp);
- if (RTEST(cval) && mol->cell != NULL && mol->frame_cells != NULL) {
+ if (RTEST(cval) && mol->cell != NULL && mol->frame_cells != NULL && index < mol->nframe_cells) {
vp = mol->frame_cells + index * 4;
MolActionCreateAndPerform(mol, gMolActionSetBox, vp, vp + 1, vp + 2, vp + 3, mol->cell->flags);
}