You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
772 B
28 lines
772 B
12 years ago
|
qt-bugs@ issue: 40192
|
||
|
applied: no
|
||
|
author: Frerich Raabe <raabe@kde.org>
|
||
|
|
||
|
This patch should fix QValueList's streaming operator>> for cases where
|
||
|
the stream operates on a byte array smaller than a Q_UINT32 (for instance,
|
||
|
QByteArray objects which are 0-3 bytes in size). It used to read one bogus
|
||
|
item because the loop would get executed once even if reading the 'c'
|
||
|
variable failed.
|
||
|
|
||
|
--- src/tools/qvaluelist.h.orig 2004-01-27 21:10:52.000000000 +0000
|
||
|
+++ src/tools/qvaluelist.h 2004-01-27 21:11:35.000000000 +0000
|
||
|
@@ -636,13 +636,11 @@
|
||
|
l.clear();
|
||
|
Q_UINT32 c;
|
||
|
s >> c;
|
||
|
- for( Q_UINT32 i = 0; i < c; ++i )
|
||
|
+ for( Q_UINT32 i = 0; i < c && !s.atEnd(); ++i )
|
||
|
{
|
||
|
T t;
|
||
|
s >> t;
|
||
|
l.append( t );
|
||
|
- if ( s.atEnd() )
|
||
|
- break;
|
||
|
}
|
||
|
return s;
|
||
|
}
|