git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14449 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2016-01-15 15:53:23 +00:00
parent bfa988207e
commit 984a1afa72
7 changed files with 114 additions and 49 deletions

View File

@ -222,8 +222,21 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf,
next = strchr(buf,'\n');
values[0] = strtok(buf," \t\n\r\f");
for (j = 1; j < nwords; j++)
if (values[0] == NULL) {
char str[128];
sprintf(str,"Too few lines in %s section of data file",keyword);
error->one(FLERR,str);
}
int format_ok = 1;
for (j = 1; j < nwords; j++) {
values[j] = strtok(NULL," \t\n\r\f");
if (values[j] == NULL) format_ok = 0;
}
if (!format_ok) {
char str[128];
sprintf(str,"Incorrect %s format in data file",keyword);
error->all(FLERR,str);
}
itag = ATOTAGINT(values[0]) + id_offset;
if (itag <= 0 || itag > map_tag_max) {