[Kst] branches/work/kst/portto4/kst/src/datasources/ascii
Peter Kümmel
syntheticpp at gmx.net
Sun Oct 14 12:32:35 UTC 2012
SVN commit 1320497 by kuemmel:
FileBuffer should check for negative bytes to read
M +4 -0 asciifilebuffer.cpp
M +0 -4 asciisource.cpp
--- branches/work/kst/portto4/kst/src/datasources/ascii/asciifilebuffer.cpp #1320496:1320497
@@ -46,6 +46,10 @@
_begin = -1;
_bytesRead = -1;
+ if (bytesToRead <= 0) {
+ return 0;
+ }
+
if (maximalBytes == -1) {
if (!resize(bytesToRead + 1))
return 0;
--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.cpp #1320496:1320497
@@ -305,10 +305,6 @@
int begin = reader.beginOfRow(s);
int bytesToRead = reader.beginOfRow(s + n) - begin;
- if (bytesToRead <= 0) {
- return 0;
- }
-
// check if the already in buffer
if ((begin != _fileBuffer->begin()) || (bytesToRead != _fileBuffer->bytesRead())) {
QFile file(_filename);
More information about the Kst
mailing list