summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/runtime/methods.cxx2
-rw-r--r--basic/source/sbx/sbxscan.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index aad84105a293..c28ddd2ca532 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1777,7 +1777,7 @@ RTLFUNC(Val)
OUString aStr( rPar.Get(1)->GetOUString() );
FilterWhiteSpace( aStr );
- if ( aStr[0] == '&' && aStr.getLength() > 1 )
+ if ( aStr.getLength() > 1 && aStr[0] == '&' )
{
int nRadix = 10;
char aChar = (char)aStr[1];
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index bc3d2cabd8bf..2d4a62948567 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -515,7 +515,7 @@ static sal_uInt16 printfmtstr( const OUString& rStr, OUString& rRes, const OUStr
aTemp.append( *pStr ? *pStr++ : static_cast< sal_Unicode >(' '));
pFmt++;
}
- while( *pFmt != '\\' );
+ while( *pFmt && *pFmt != '\\' );
aTemp.append(*pStr ? *pStr++ : static_cast< sal_Unicode >(' '));
pFmt++; break;
case '&':