summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2014-06-24 08:41:11 +0300
committerAlex Trotsenko <alex1973tr@gmail.com>2014-06-24 18:48:33 +0200
commit7cc893b2169555a8c4d8242f69e7ef12ebc36185 (patch)
treeab81f6269a591311c7e957aa6ecda4fd82c73319 /src/corelib/tools
parent00dce1cc0078f9633d121908172346cc22deb3c3 (diff)
Fix QRingBuffer::readPointerAtPosition()
Fix condition to allow return a valid pointer when head != 0. Change-Id: I5215f7dfc44924016c2d9b67ab2d9935b5164d7a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qringbuffer_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h
index b17c6d2f40..5d25b0add1 100644
--- a/src/corelib/tools/qringbuffer_p.h
+++ b/src/corelib/tools/qringbuffer_p.h
@@ -90,7 +90,7 @@ public:
// special case: it is in the first buffer
int nextDataBlockSizeValue = nextDataBlockSize();
- if (pos - head < nextDataBlockSizeValue) {
+ if (pos < nextDataBlockSizeValue) {
length = nextDataBlockSizeValue - pos;
return buffers.at(0).constData() + head + pos;
}