Kaydet (Commit) 760bba09 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

WaE: possible loss of data

Change-Id: Ib442a7cae9f4c9bc5e32c20f1e1844a191f5b057
üst b41ab20a
...@@ -87,7 +87,7 @@ namespace osl { ...@@ -87,7 +87,7 @@ namespace osl {
sal_uInt32 nFirstId, const std::list< rtl::OString >& rStrings, sal_uInt32 nFirstId, const std::list< rtl::OString >& rStrings,
sal_uInt32 nDefault) sal_uInt32 nDefault)
{ {
int nItems = rStrings.size(); size_t nItems = rStrings.size();
const sal_Char** pStrings = new const sal_Char*[ nItems+1 ]; const sal_Char** pStrings = new const sal_Char*[ nItems+1 ];
std::list< rtl::OString >::const_iterator it = rStrings.begin(); std::list< rtl::OString >::const_iterator it = rStrings.begin();
nItems = 0; nItems = 0;
...@@ -117,7 +117,7 @@ namespace osl { ...@@ -117,7 +117,7 @@ namespace osl {
sal_uInt32 nFirstId, const std::list< rtl::OString >& rStrings, sal_uInt32 nFirstId, const std::list< rtl::OString >& rStrings,
sal_uInt32 nValue) sal_uInt32 nValue)
{ {
int nItems = rStrings.size(); size_t nItems = rStrings.size();
const sal_Char** pStrings = new const sal_Char*[ nItems+1 ]; const sal_Char** pStrings = new const sal_Char*[ nItems+1 ];
std::list< rtl::OString >::const_iterator it = rStrings.begin(); std::list< rtl::OString >::const_iterator it = rStrings.begin();
nItems = 0; nItems = 0;
...@@ -152,12 +152,12 @@ namespace osl { ...@@ -152,12 +152,12 @@ namespace osl {
std::list< rtl::OString > aEntries; std::list< rtl::OString > aEntries;
// count buffer size necessary // count buffer size necessary
int n = osl_getProfileSectionEntries( profile, rSection.getStr(), NULL, 0 ); size_t n = osl_getProfileSectionEntries( profile, rSection.getStr(), NULL, 0 );
if( n > 1 ) if( n > 1 )
{ {
sal_Char* pBuf = new sal_Char[ n+1 ]; sal_Char* pBuf = new sal_Char[ n+1 ];
osl_getProfileSectionEntries( profile, rSection.getStr(), pBuf, n+1 ); osl_getProfileSectionEntries( profile, rSection.getStr(), pBuf, n+1 );
int nLen; size_t nLen;
for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 ) for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 )
aEntries.push_back( rtl::OString( pBuf+n ) ); aEntries.push_back( rtl::OString( pBuf+n ) );
delete pBuf; delete pBuf;
...@@ -174,12 +174,12 @@ namespace osl { ...@@ -174,12 +174,12 @@ namespace osl {
std::list< rtl::OString > aSections; std::list< rtl::OString > aSections;
// count buffer size necessary // count buffer size necessary
int n = osl_getProfileSections( profile, NULL, 0 ); size_t n = osl_getProfileSections( profile, NULL, 0 );
if( n > 1 ) if( n > 1 )
{ {
sal_Char* pBuf = new sal_Char[ n+1 ]; sal_Char* pBuf = new sal_Char[ n+1 ];
osl_getProfileSections( profile, pBuf, n+1 ); osl_getProfileSections( profile, pBuf, n+1 );
int nLen; size_t nLen;
for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 ) for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 )
aSections.push_back( rtl::OString( pBuf+n ) ); aSections.push_back( rtl::OString( pBuf+n ) );
delete pBuf; delete pBuf;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment