Fix reading empty type label string in restart
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user