use more accurate strncmp() check instead of strstr() and apply the same change to all affected variants of fix nvt/sllod

This commit is contained in:
Axel Kohlmeyer
2018-12-12 00:02:06 -05:00
parent 113a2e328e
commit 5362b1cfde
4 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@ void FixNVTSllodEff::init()
int i;
for (i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
if (strncmp(modify->fix[i]->style,"deform",6) == 0) {
if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using fix nvt/sllod/eff with inconsistent fix deform "
"remap option");

View File

@ -76,7 +76,7 @@ void FixNVTSllodIntel::init()
int i;
for (i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
if (strncmp(modify->fix[i]->style,"deform",6) == 0) {
if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform "
"remap option");

View File

@ -82,7 +82,7 @@ void FixNVTSllodOMP::init()
int i;
for (i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
if (strncmp(modify->fix[i]->style,"deform",6) == 0) {
if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using fix nvt/sllod/omp with inconsistent fix "
"deform remap option");

View File

@ -80,7 +80,7 @@ void FixNVTSllod::init()
int i;
for (i = 0; i < modify->nfix; i++)
if (strstr(modify->fix[i]->style,"deform")) {
if (strncmp(modify->fix[i]->style,"deform",6) == 0) {
if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform "
"remap option");