From af5f1fbcb6a5349e6d5ee137a21a78c97d2c138c Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Thu, 1 Aug 2002 16:53:14 +0000 Subject: [PATCH] * fix for StrPas() by Sergey Korshunoff (merged) --- rtl/objpas/syspch.inc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/rtl/objpas/syspch.inc b/rtl/objpas/syspch.inc index 149fd9fe32..2311cb92ef 100644 --- a/rtl/objpas/syspch.inc +++ b/rtl/objpas/syspch.inc @@ -36,13 +36,8 @@ type { StrPas converts a PChar to a pascal string } function StrPas(Str: PChar): string; -var - l: Integer; begin - l := StrLen(Str); - SetLength(result, l); - if l > 0 then - Move(Str^, result[1], l); + Result:=Str; end ; { StrAlloc allocates a buffer of Size + 4 @@ -122,7 +117,10 @@ end ; { $Log$ - Revision 1.4 2001-07-30 10:21:09 sg + Revision 1.5 2002-08-01 16:53:14 jonas + * fix for StrPas() by Sergey Korshunoff (merged) + + Revision 1.4 2001/07/30 10:21:09 sg * Two moves with a string as target are now only exectuted if the number of bytes to move is greater than 0. This prevents RTE201's when compiled with range checks enabled.