[Kst] branches/work/kst/portto4/kst/src/datasources/ascii

Peter Kümmel syntheticpp at gmx.net
Thu Jan 27 11:22:22 CET 2011


SVN commit 1217447 by kuemmel:

fix endless loop when no frame were found in the read data

 M  +2 -1      asciisource.cpp  


--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.cpp #1217446:1217447
@@ -330,12 +330,13 @@
   _byteLength = file.size();
 
   int bufread = 0;
+  int bufstart = _rowIndex[_numFrames];
   do {
     // Read the tmpbuffer, starting at row_index[_numFrames]
     QVarLengthArray<char, MAXBUFREADLEN + 1> varBuffer;
     varBuffer.resize(varBuffer.capacity());
 
-    int bufstart = _rowIndex[_numFrames];
+    bufstart += bufread;
     bufread = readFromFile(file, varBuffer, bufstart, _byteLength - bufstart, MAXBUFREADLEN);    
 
 #ifdef KST_DONT_CHECK_INDEX_IN_DEBUG


More information about the Kst mailing list