diff options
author | Caolán McNamara <cmc@openoffice.org> | 2010-05-24 10:24:59 +0100 |
---|---|---|
committer | Caolán McNamara <cmc@openoffice.org> | 2010-05-24 10:24:59 +0100 |
commit | c938b8a6908c27d74738b097d35092abc7329ef0 (patch) | |
tree | b204a5ef560ab827868373cc5395e3e55ab971aa /i18npool | |
parent | 8be5473582771bf41b3630dd04a6ff0f56637c59 (diff) |
cmcfixes75: #i111792# check fread return value
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/localedata/saxparser.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/i18npool/source/localedata/saxparser.cxx b/i18npool/source/localedata/saxparser.cxx index 083d2097a54a..9787b9c810a6 100644 --- a/i18npool/source/localedata/saxparser.cxx +++ b/i18npool/source/localedata/saxparser.cxx @@ -125,13 +125,14 @@ Reference< XInputStream > createStreamFromFile( if( f ) { fseek( f , 0 , SEEK_END ); - int nLength = ftell( f ); + size_t nLength = ftell( f ); fseek( f , 0 , SEEK_SET ); Sequence<sal_Int8> seqIn(nLength); - fread( seqIn.getArray() , nLength , 1 , f ); - - r = Reference< XInputStream > ( new OInputStream( seqIn ) ); + if (fread( seqIn.getArray() , nLength , 1 , f ) == 1) + r = Reference< XInputStream > ( new OInputStream( seqIn ) ); + else + fprintf(stderr, "failure reading %s\n", pcFile); fclose( f ); } return r; |