diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-05-03 22:33:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-05-03 22:34:17 +0100 |
commit | 76cc8aca4270bc2542cc8444d07f80d578eb6581 (patch) | |
tree | 3119ba28e5604b62c9d746a77b6110212e31751f /extensions/source/plugin/base/context.cxx | |
parent | fff2d18a08a37c0fa6a370e56591117fc08664d2 (diff) |
WaE: unchecked results from write/fwrite
Change-Id: Ia7943a132d05e596550bd71878b54b2825c31987
Diffstat (limited to 'extensions/source/plugin/base/context.cxx')
-rw-r--r-- | extensions/source/plugin/base/context.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/extensions/source/plugin/base/context.cxx b/extensions/source/plugin/base/context.cxx index 05978fe09cb6..217a4bbe7064 100644 --- a/extensions/source/plugin/base/context.cxx +++ b/extensions/source/plugin/base/context.cxx @@ -44,6 +44,7 @@ #include <plugin/impl.hxx> +#include <sal/log.hxx> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <tools/fsys.hxx> @@ -340,7 +341,11 @@ void FileSink::closeOutput() throw() void FileSink::writeBytes( const Sequence<sal_Int8>& Buffer ) throw() { if( fp ) - fwrite( Buffer.getConstArray(), 1, Buffer.getLength(), fp ); + { + size_t nItems = Buffer.getLength(); + bool bSuccess = (fwrite(Buffer.getConstArray(), 1, nItems, fp) == nItems); + SAL_WARN_IF( !bSuccess, "extensions", "short write"); + } } void FileSink::flush() throw() |