diff options
author | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2011-02-28 10:08:33 +0100 |
---|---|---|
committer | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2011-02-28 10:08:33 +0100 |
commit | 0beb3b7f484c96194ca24a013e8e0c856e8cdb6b (patch) | |
tree | dbc9448c0aa4af83e5f83b6e36aa8094ec8f5fbb /io | |
parent | dr78: fix com.sun.star.io.XTextInputStream.readString implementation() when p... (diff) | |
parent | merged DEV300 (diff) | |
download | core-0beb3b7f484c96194ca24a013e8e0c856e8cdb6b.tar.gz core-0beb3b7f484c96194ca24a013e8e0c856e8cdb6b.zip |
dr78: rebase to DEV300_m101
Diffstat (limited to 'io')
-rw-r--r-- | io/source/acceptor/acc_pipe.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/io/source/acceptor/acc_pipe.cxx b/io/source/acceptor/acc_pipe.cxx index 6d0b77484fef..63f688d32dca 100644 --- a/io/source/acceptor/acc_pipe.cxx +++ b/io/source/acceptor/acc_pipe.cxx @@ -101,11 +101,17 @@ namespace io_acceptor { if( ! m_nStatus ) { - if( aReadBytes.getLength() != nBytesToRead ) + if( aReadBytes.getLength() < nBytesToRead ) { aReadBytes.realloc( nBytesToRead ); } - return m_pipe.read( aReadBytes.getArray() , aReadBytes.getLength() ); + sal_Int32 n = m_pipe.read( aReadBytes.getArray(), nBytesToRead ); + OSL_ASSERT( n >= 0 && n <= aReadBytes.getLength() ); + if( n < aReadBytes.getLength() ) + { + aReadBytes.realloc( n ); + } + return n; } else { throw IOException(); |