From b1d0dd65ea07b9f7669a661dcdd9ddf06fd3c9ad Mon Sep 17 00:00:00 2001 From: nw13slx Date: Mon, 13 Dec 2021 22:57:39 -0500 Subject: [PATCH] simply the while loop and add correct initial m value --- src/reader_native.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) 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");