diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-10-10 13:02:43 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-10-10 13:02:43 +0000 |
commit | aba2169bfb03658f4be056b59b29657adbb9a6c2 (patch) | |
tree | c90c38d1c6065734677f6f938adbedf4d2bb5ed5 /extensions/source/logging/plaintextformatter.cxx | |
parent | 63e30833f94fa7e76cc799402ba43071cff5d2d0 (diff) |
CWS-TOOLING: integrate CWS cmcfixes49
Diffstat (limited to 'extensions/source/logging/plaintextformatter.cxx')
-rw-r--r-- | extensions/source/logging/plaintextformatter.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/extensions/source/logging/plaintextformatter.cxx b/extensions/source/logging/plaintextformatter.cxx index 2a8713747c37..fb12de2f1b8d 100644 --- a/extensions/source/logging/plaintextformatter.cxx +++ b/extensions/source/logging/plaintextformatter.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: plaintextformatter.cxx,v $ - * $Revision: 1.4 $ + * $Revision: 1.4.82.1 $ * * This file is part of OpenOffice.org. * @@ -132,10 +132,10 @@ namespace logging ::rtl::OUString SAL_CALL PlainTextFormatter::format( const LogRecord& _rRecord ) throw (RuntimeException) { char buffer[ 30 ]; - const size_t buffer_size = sizeof( buffer ); - size_t used = snprintf( buffer, buffer_size, "%10i", (int)_rRecord.SequenceNumber ); - if ( used >= buffer_size ) - buffer[ buffer_size ] = 0; + const int buffer_size = sizeof( buffer ); + int used = snprintf( buffer, buffer_size, "%10i", (int)_rRecord.SequenceNumber ); + if ( used >= buffer_size || used < 0 ) + buffer[ buffer_size - 1 ] = 0; ::rtl::OUStringBuffer aLogEntry; aLogEntry.appendAscii( buffer ); |