summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/runtime/methods.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 14cd3d7f430c..20267e09a5fb 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: methods.cxx,v $
*
- * $Revision: 1.52 $
+ * $Revision: 1.53 $
*
- * last change: $Author: vg $ $Date: 2004-01-06 19:42:37 $
+ * last change: $Author: kz $ $Date: 2004-02-26 16:23:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1386,9 +1386,12 @@ RTLFUNC(String)
{
String aStr;
sal_Unicode aFiller;
- USHORT nCount = (USHORT)(rPar.Get(1)->GetLong());
+ INT32 lCount = rPar.Get(1)->GetLong();
+ if( lCount < 0 || lCount > 0xffff )
+ StarBASIC::Error( SbERR_BAD_ARGUMENT );
+ USHORT nCount = (USHORT)lCount;
if( rPar.Get(2)->GetType() == SbxINTEGER )
- aFiller = (char)rPar.Get(2)->GetInteger();
+ aFiller = (sal_Unicode)rPar.Get(2)->GetInteger();
else
{
const String& rStr = rPar.Get(2)->GetString();