git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14058 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -56,11 +56,17 @@ int ReaderXYZ::read_time(bigint &ntimestep)
|
||||
{
|
||||
char *eof = fgets(line,MAXLINE,fp);
|
||||
if (eof == NULL) return 1;
|
||||
int n = strlen(line);
|
||||
if (n > 0) line[n-1] = '\0'; // strip newline
|
||||
|
||||
// first line has to have the number of atoms
|
||||
// truncate the string to the first whitespace,
|
||||
// so force->bnumeric() does not hiccup
|
||||
|
||||
for (int i=0; (i < MAXLINE) && (eof[i] != '\0'); ++i) {
|
||||
if (eof[i] == '\n' || eof[i] == '\r' || eof[i] == ' ' || eof[i] == '\t') {
|
||||
eof[i] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
natoms = force->bnumeric(FLERR,line);
|
||||
if (natoms < 1)
|
||||
error->one(FLERR,"Dump file is incorrectly formatted");
|
||||
|
||||
Reference in New Issue
Block a user