From ad7b27a67adff911cece12b002b93505961860a1 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Fri, 19 May 2023 22:27:28 -0400 Subject: [PATCH] correct logic --- src/variable.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/variable.cpp b/src/variable.cpp index 449efe6d7b..6eb483976b 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -4089,10 +4089,10 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree **t print_var_error(FLERR, fmt::format("Invalid kind {} in label2type() in variable",kind),ivar); } - if (strcmp(word,"label2type") == 0 && value == -1) - print_var_error(FLERR, fmt::format("Invalid {} type label {} in label2type() in variable", - kind, typestr), ivar); - else value = (value == -1) ? 0.0 : 1.0; + if (strcmp(word,"label2type")) == 0) { + if (value == -1) print_var_error(FLERR, fmt::format("Invalid {} type label {} in label2type() in variable", + kind, typestr), ivar); + } else value = (value == -1) ? 0.0 : 1.0; // save value in tree or on argstack