assume type labels begin with letter

This commit is contained in:
Jacob Gissinger
2021-01-19 22:56:06 -05:00
parent 739dc46fab
commit a0c4fac428
4 changed files with 27 additions and 17 deletions

View File

@ -100,10 +100,13 @@ void LabelMap::modify_lmap(int narg, char **arg)
int itype;
int iarg = 1;
char *charlabel;
while (iarg < narg) {
itype = utils::inumeric(FLERR,arg[iarg++],false,lmp);
charlabel = arg[iarg++];
if (itype > ntypes) error->all(FLERR,"Topology type exceeds system topology type");
(*labels)[itype-1] = arg[iarg++];
if (!isalpha(charlabel[0])) error->all(FLERR,"Type labels must begin with a letter");
(*labels)[itype-1] = charlabel;
}
}