summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/runtime/methods.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 535160608f70..ac4b9c4f250e 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1302,7 +1302,8 @@ RTLFUNC(Mid)
{
nLen = aArgStr.getLength() - nStartPos;
}
- aResultStr = aArgStr.copy( nStartPos, nLen );
+ if (nLen > 0)
+ aResultStr = aArgStr.copy( nStartPos, nLen );
}
rPar.Get(0)->PutString( aResultStr );
}