diff --git a/src/reader_native.cpp b/src/reader_native.cpp index 56a55c642e..8cacb8533b 100644 --- a/src/reader_native.cpp +++ b/src/reader_native.cpp @@ -469,12 +469,10 @@ void ReaderNative::read_atoms(int n, int nfield, double **fields) // read chunk and write as size_one values per line // until end of timestep or end of the reading buffer - int i_atom = 0; - int m; - bool continue_reading = true; - bool continue_chunks = true; - while (continue_reading && continue_chunks){ - + int m=size_one*iatom_chunk; + bool continue_reading = (n>0); + bool continue_chunks = (ichunk maxbuf) { memory->grow(databuf,count,"reader:databuf");