summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2003-11-25 09:40:56 +0000
committerRüdiger Timm <rt@openoffice.org>2003-11-25 09:40:56 +0000
commit7f99a38fe10dfcb7f4c568442eeb49dbfab6425e (patch)
tree349a86262b186a833712ee7aa67e32ac6acd9b5d
parentc95843cb4f950442636559c64898a6f39db16301 (diff)
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.
-rw-r--r--tools/source/stream/stream.cxx12
1 files 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 )