Skip to content

Commit cdcfc25

Browse files
author
Tosco, Paolo
committed
Merge branch 'atom-idx-out-of-bounds-bond-table' into pre-release
2 parents afdbe0e + 5ab6468 commit cdcfc25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/C/common/reaccsio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,11 @@ int ReadREACCSBond(Fortran_FILE *fp, struct reaccs_bond_t *bp)
352352
nitems = MAX_BONDLINE_FIELDS;
353353
for (i = 0; i < nitems; ++i)
354354
{
355-
pos = i * 3;
355+
pos = i * BONDLINE_FIELD_LEN;
356356
memset(buffer, 0, BONDLINE_FIELD_LEN + 1);
357357
n_chars = bond_line_len - pos;
358-
if (n_chars > 3)
359-
n_chars = 3;
358+
if (n_chars > BONDLINE_FIELD_LEN)
359+
n_chars = BONDLINE_FIELD_LEN;
360360
for (j = 0, k = 0; j < n_chars; ++j)
361361
{
362362
c = fp->buffer[pos + j];

0 commit comments

Comments
 (0)