summaryrefslogtreecommitdiff
path: root/qmake/tools/qbuffer.cpp
Side-by-side diff
Diffstat (limited to 'qmake/tools/qbuffer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/tools/qbuffer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qmake/tools/qbuffer.cpp b/qmake/tools/qbuffer.cpp
index b213dd9..0fc90e4 100644
--- a/qmake/tools/qbuffer.cpp
+++ b/qmake/tools/qbuffer.cpp
@@ -175,50 +175,50 @@ bool QBuffer::setBuffer( QByteArray buf )
otherwise returns FALSE. The buffer must be opened before use.
The mode parameter \a m must be a combination of the following flags.
\list
\i \c IO_ReadOnly opens the buffer in read-only mode.
\i \c IO_WriteOnly opens the buffer in write-only mode.
\i \c IO_ReadWrite opens the buffer in read/write mode.
\i \c IO_Append sets the buffer index to the end of the buffer.
\i \c IO_Truncate truncates the buffer.
\endlist
\sa close(), isOpen()
*/
bool QBuffer::open( int m )
{
if ( isOpen() ) { // buffer already open
#if defined(QT_CHECK_STATE)
qWarning( "QBuffer::open: Buffer already open" );
#endif
return FALSE;
}
setMode( m );
if ( m & IO_Truncate ) { // truncate buffer
- a.resize( 0 );
- a_len = 0;
+ a.resize( 1 );
+ a_len = 1;
}
if ( m & IO_Append ) { // append to end of buffer
ioIndex = a.size();
} else {
ioIndex = 0;
}
a_inc = 16;
setState( IO_Open );
setStatus( 0 );
return TRUE;
}
/*!
\reimp
Closes an open buffer.
\sa open()
*/
void QBuffer::close()
{
if ( isOpen() ) {
setFlags( IO_Direct );