From 83d58ba57d4377c727f800537b601c9e550ed4c9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 6 Jul 2020 00:10:43 -0400 Subject: [PATCH] we may not use "suffix on" before a suffix is defined. switching back to a non-hybrid suffix must set suffix2 to NULL --- src/input.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index e5f8034e72..41501328c6 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1904,8 +1904,11 @@ void Input::suffix() if (narg < 1) error->all(FLERR,"Illegal suffix command"); if (strcmp(arg[0],"off") == 0) lmp->suffix_enable = 0; - else if (strcmp(arg[0],"on") == 0) lmp->suffix_enable = 1; - else { + else if (strcmp(arg[0],"on") == 0) { + if (!lmp->suffix) + error->all(FLERR,"May only enable suffixes after defining one"); + lmp->suffix_enable = 1; + } else { lmp->suffix_enable = 1; delete [] lmp->suffix; @@ -1924,6 +1927,7 @@ void Input::suffix() int n = strlen(arg[0]) + 1; lmp->suffix = new char[n]; strcpy(lmp->suffix,arg[0]); + lmp->suffix2 = nullptr; } } }