From 12310746edc0f43e4b1be84e311dd0dee12701cd Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Feb 2012 16:12:18 +0000 Subject: accumulate into an OStringBuffer --- desktop/source/app/officeipcthread.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'desktop') diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index a0d2f3fe78bb..38babd8cecf9 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -669,22 +669,24 @@ void OfficeIPCThread::execute() // down during wait osl::ClearableMutexGuard aGuard( GetMutex() ); - ByteString aArguments; // test byte by byte const int nBufSz = 2048; char pBuf[nBufSz]; int nBytes = 0; int nResult = 0; + rtl::OStringBuffer aBuf; // read into pBuf until '\0' is read or read-error while ((nResult=maStreamPipe.recv( pBuf+nBytes, nBufSz-nBytes))>0) { nBytes += nResult; if (pBuf[nBytes-1]=='\0') { - aArguments += pBuf; + aBuf.append(pBuf); break; } } // don't close pipe ... + ByteString aArguments = aBuf.makeStringAndClear(); + // Is this a lookup message from another application? if so, ignore if ( aArguments.Len() == 0 ) continue; -- cgit