From 53a1f74ef10733cb1a3272a2f6462c03b42fbb56 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 9 Nov 2012 16:08:11 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9040 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/read_data.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/read_data.cpp b/src/read_data.cpp index a691eb562b..658ac11caa 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -552,6 +552,7 @@ void ReadData::atoms() if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buffer[m]); } + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); m++; } MPI_Bcast(&m,1,MPI_INT,0,world); @@ -644,6 +645,7 @@ void ReadData::velocities() if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buffer[m]); } + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); m++; } MPI_Bcast(&m,1,MPI_INT,0,world); @@ -695,6 +697,7 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type) if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buffer[m]); } + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); m++; } MPI_Bcast(&m,1,MPI_INT,0,world); @@ -734,6 +737,7 @@ void ReadData::bonds() if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buffer[m]); } + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); m++; } MPI_Bcast(&m,1,MPI_INT,0,world); @@ -780,6 +784,7 @@ void ReadData::angles() if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buffer[m]); } + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); m++; } MPI_Bcast(&m,1,MPI_INT,0,world); @@ -826,6 +831,7 @@ void ReadData::dihedrals() if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buffer[m]); } + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); m++; } MPI_Bcast(&m,1,MPI_INT,0,world); @@ -872,6 +878,7 @@ void ReadData::impropers() if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buffer[m]); } + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); m++; } MPI_Bcast(&m,1,MPI_INT,0,world); @@ -914,6 +921,7 @@ void ReadData::mass() eof = fgets(&buf[m],MAXLINE,fp); if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buf[m]); + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); buf[m-1] = '\0'; } } @@ -943,6 +951,7 @@ void ReadData::paircoeffs() eof = fgets(&buf[m],MAXLINE,fp); if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buf[m]); + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); buf[m-1] = '\0'; } } @@ -974,6 +983,7 @@ void ReadData::bondcoeffs() eof = fgets(&buf[m],MAXLINE,fp); if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buf[m]); + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); buf[m-1] = '\0'; } } @@ -1005,6 +1015,7 @@ void ReadData::anglecoeffs(int which) eof = fgets(&buf[m],MAXLINE,fp); if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buf[m]); + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); buf[m-1] = '\0'; } } @@ -1038,6 +1049,7 @@ void ReadData::dihedralcoeffs(int which) eof = fgets(&buf[m],MAXLINE,fp); if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buf[m]); + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); buf[m-1] = '\0'; } } @@ -1074,6 +1086,7 @@ void ReadData::impropercoeffs(int which) eof = fgets(&buf[m],MAXLINE,fp); if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buf[m]); + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); buf[m-1] = '\0'; } } @@ -1113,6 +1126,7 @@ void ReadData::fix(int ifix, char *line, bigint nlines) if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); m += strlen(&buffer[m]); } + if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); m++; } MPI_Bcast(&m,1,MPI_INT,0,world);