From 9ec55dcb1fb0d68e2bfcb0c675e63b1382218206 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 30 May 2023 19:10:11 -0400 Subject: [PATCH] silence compiler warning --- src/variable.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/variable.cpp b/src/variable.cpp index 4fb6939866..20fb5ccee8 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -4068,12 +4068,16 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree **t std::string contents_copy(contents); auto pos = contents_copy.find_first_of(','); - if (pos == std::string::npos) - if (strcmp(word,"label2type") == 0) + if (pos == std::string::npos) { + if (strcmp(word,"label2type") == 0) { print_var_error(FLERR, fmt::format("Invalid label2type({}) function in variable formula", contents_copy), ivar); - else print_var_error(FLERR, fmt::format("Invalid is_typelabel({}) function in variable formula", - contents_copy), ivar); + } else { + print_var_error(FLERR, fmt::format("Invalid is_typelabel({}) function in variable formula", + contents_copy), ivar); + } + } + std::string typestr = contents_copy.substr(pos+1); std::string kind = contents_copy.substr(0, pos);