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 | 67894eaef9e2b3732c953a7e99608f77e7a3be74 (patch) | |
tree | 60c7fc6ea0ae1edf663fb8d9a17326874ffebbac /i18npool/source/localedata/saxparser.cxx | |
parent | 2fda5d730a078aeee7144640601e7a32557ed598 (diff) |
cmcfixes75: #i111792# check fread return value
Diffstat (limited to 'i18npool/source/localedata/saxparser.cxx')
-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 a2d216ceea..6ebdec19fc 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; |