diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-05-03 21:11:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-05-03 21:11:42 +0100 |
commit | c77110b486cab2e1d003013c26ec327dfa4d6959 (patch) | |
tree | eade18505e4d5c06e548cf243fca6f8579b15661 /rsc | |
parent | 2033e7c4f2c0a199dc6124e2ec519f06e7bf0aa3 (diff) |
WaE: ignoring return value of fwrite
Change-Id: I289564b8f41bbae976853aa3994751d3092ff44d
Diffstat (limited to 'rsc')
-rw-r--r-- | rsc/source/parser/rscdb.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx index ce35473b869a..c7c61c260ae0 100644 --- a/rsc/source/parser/rscdb.cxx +++ b/rsc/source/parser/rscdb.cxx @@ -36,6 +36,7 @@ #include <tools/fsys.hxx> #include <tools/rc.h> #include <rtl/strbuf.hxx> +#include <sal/log.hxx> #include <sal/macros.h> // Programmabhaengige Includes. @@ -528,7 +529,8 @@ IMPL_LINK_INLINE_END( RscEnumerateObj, CallBackWriteHxx, ObjNode *, pObjNode ) |* RscEnumerateObj :: WriteRcFile |* *************************************************************************/ -void RscEnumerateObj :: WriteRcFile( RscWriteRc & rMem, FILE * fOut ){ +void RscEnumerateObj :: WriteRcFile( RscWriteRc & rMem, FILE * fOut ) +{ // Definition der Struktur, aus denen die Resource aufgebaut ist /* struct RSHEADER_TYPE{ @@ -568,8 +570,8 @@ void RscEnumerateObj :: WriteRcFile( RscWriteRc & rMem, FILE * fOut ){ //Position wurde vorher in Tabelle geschrieben - fwrite( rMem.GetBuffer(), rMem.Size(), 1, fOut ); - + bool bSuccess = (1 == fwrite( rMem.GetBuffer(), rMem.Size(), 1, fOut )); + SAL_WARN_IF(!bSuccess, "rsc", "short write"); }; class RscEnumerateRef @@ -721,7 +723,9 @@ void RscTypCont :: WriteSrc( FILE * fOutput, sal_uLong nFileKey, RscEnumerateRef aEnumRef( this, pRoot, fOutput ); unsigned char aUTF8BOM[3] = { 0xef, 0xbb, 0xbf }; - fwrite( aUTF8BOM, sizeof(unsigned char), SAL_N_ELEMENTS(aUTF8BOM), fOutput ); + size_t nItems = SAL_N_ELEMENTS(aUTF8BOM); + bool bSuccess = (nItems == fwrite(aUTF8BOM, 1, nItems, fOutput)); + SAL_WARN_IF(!bSuccess, "rsc", "short write"); if( bName ) { WriteInc( fOutput, nFileKey ); |