From 9c9fac49d721e61a8da78fd2ce146d56036c7028 Mon Sep 17 00:00:00 2001 From: k-harris27 <120191386+k-harris27@users.noreply.github.com> Date: Wed, 31 Jul 2024 10:02:04 +0100 Subject: [PATCH] Fix reading empty type label string in restart --- src/label_map.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/label_map.cpp b/src/label_map.cpp index a9ffd60877..174f16a7ec 100644 --- a/src/label_map.cpp +++ b/src/label_map.cpp @@ -369,35 +369,35 @@ void LabelMap::read_restart(FILE *fp) for (int i = 0; i < natomtypes; i++) { charlabel = read_string(fp); typelabel[i] = charlabel; - typelabel_map[charlabel] = i + 1; + if (strlen(charlabel) > 0) typelabel_map[charlabel] = i + 1; delete[] charlabel; } for (int i = 0; i < nbondtypes; i++) { charlabel = read_string(fp); btypelabel[i] = charlabel; - btypelabel_map[charlabel] = i + 1; + if (strlen(charlabel) > 0) btypelabel_map[charlabel] = i + 1; delete[] charlabel; } for (int i = 0; i < nangletypes; i++) { charlabel = read_string(fp); atypelabel[i] = charlabel; - atypelabel_map[charlabel] = i + 1; + if (strlen(charlabel) > 0) atypelabel_map[charlabel] = i + 1; delete[] charlabel; } for (int i = 0; i < ndihedraltypes; i++) { charlabel = read_string(fp); dtypelabel[i] = charlabel; - dtypelabel_map[charlabel] = i + 1; + if (strlen(charlabel) > 0) dtypelabel_map[charlabel] = i + 1; delete[] charlabel; } for (int i = 0; i < nimpropertypes; i++) { charlabel = read_string(fp); itypelabel[i] = charlabel; - itypelabel_map[charlabel] = i + 1; + if (strlen(charlabel) > 0) itypelabel_map[charlabel] = i + 1; delete[] charlabel; } }