From ff48f28f71609b0ab4e6b8bc79818f765e48fddd Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 19 Jan 2014 21:56:40 +0100 Subject: [PATCH] Resolves: fdo#73771 Non-standard behaviour for Function Mid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I90be516235228574dc219447a0eef3a34f83bee2 Reviewed-on: https://gerrit.libreoffice.org/7539 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- basic/source/runtime/methods.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 36d7c3cba782..efa3ea9d8c6b 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 ); }