From c77110b486cab2e1d003013c26ec327dfa4d6959 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 3 May 2012 21:11:42 +0100 Subject: WaE: ignoring return value of fwrite Change-Id: I289564b8f41bbae976853aa3994751d3092ff44d --- rsc/source/parser/rscdb.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'rsc/source') 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 #include #include +#include #include // 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 ); -- cgit