avoid segfault on short data read when parsing tabulated potentials
This commit is contained in:
@ -398,6 +398,9 @@ void PairTable::read_table(Table *tb, char *file, char *keyword)
|
||||
reader.skip_line();
|
||||
for (int i = 0; i < tb->ninput; i++) {
|
||||
line = reader.next_line();
|
||||
if (!line)
|
||||
error->one(FLERR, "Data missing when parsing pair table '{}' line {} of {}.", keyword, i + 1,
|
||||
tb->ninput);
|
||||
try {
|
||||
ValueTokenizer values(line);
|
||||
values.next_int();
|
||||
|
||||
Reference in New Issue
Block a user