From 7f99a38fe10dfcb7f4c568442eeb49dbfab6425e Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Tue, 25 Nov 2003 09:40:56 +0000 Subject: INTEGRATION: CWS valgrind01 (1.13.60); FILE MERGED 2003/09/30 12:18:24 hr 1.13.60.1: #i20184#: SvStream::ReadLine(): check the return value of Read(). Thanks to Lulian Seward for providing a patch. --- tools/source/stream/stream.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index cab72767a788..f95ee93d942b 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -2,9 +2,9 @@ * * $RCSfile: stream.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: vg $ $Date: 2003-04-17 13:24:15 $ + * last change: $Author: rt $ $Date: 2003-11-25 10:40:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -795,9 +795,11 @@ BOOL SvStream::ReadLine( ByteString& rStr ) if ( bEnd && (c=='\r' || c=='\n') ) // Sonderbehandlung DOS-Dateien { char cTemp; - Read((char*)&cTemp , sizeof(cTemp) ); - if( cTemp == c || (cTemp != '\n' && cTemp != '\r') ) - Seek( nOldFilePos ); + ULONG nLen = Read((char*)&cTemp , sizeof(cTemp) ); + if ( nLen ) { + if( cTemp == c || (cTemp != '\n' && cTemp != '\r') ) + Seek( nOldFilePos ); + } } if ( bEnd ) -- cgit