diff --git a/src/MOLECULE/angle_table.cpp b/src/MOLECULE/angle_table.cpp index 0be817acc7..88b1f97ac6 100644 --- a/src/MOLECULE/angle_table.cpp +++ b/src/MOLECULE/angle_table.cpp @@ -379,7 +379,8 @@ void AngleTable::read_table(Table *tb, char *file, char *keyword) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment - if (strstr(line,keyword) == line) break; // matching keyword + char *word = strtok(line," \t\n\r"); + if (strcmp(word,keyword) == 0) break; // matching keyword fgets(line,MAXLINE,fp); // no match, skip section param_extract(tb,line); fgets(line,MAXLINE,fp); diff --git a/src/MOLECULE/bond_table.cpp b/src/MOLECULE/bond_table.cpp index 1f83c7980f..dc6a637d8b 100644 --- a/src/MOLECULE/bond_table.cpp +++ b/src/MOLECULE/bond_table.cpp @@ -302,7 +302,8 @@ void BondTable::read_table(Table *tb, char *file, char *keyword) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment - if (strstr(line,keyword) == line) break; // matching keyword + char *word = strtok(line," \t\n\r"); + if (strcmp(word,keyword) == 0) break; // matching keyword fgets(line,MAXLINE,fp); // no match, skip section param_extract(tb,line); fgets(line,MAXLINE,fp); diff --git a/src/USER-MISC/dihedral_table.cpp b/src/USER-MISC/dihedral_table.cpp index 89d4b6e39d..7465779c0d 100644 --- a/src/USER-MISC/dihedral_table.cpp +++ b/src/USER-MISC/dihedral_table.cpp @@ -703,7 +703,8 @@ void DihedralTable::read_table(Table *tb, char *file, char *keyword) } if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment - if (strstr(line,keyword) == line) break; // matching keyword + char *word = strtok(line," \t\n\r"); + if (strcmp(word,keyword) == 0) break; // matching keyword fgets(line,MAXLINE,fp); // no match, skip section param_extract(tb,line); fgets(line,MAXLINE,fp);