From 7fb2a035e3189fa299a514d93223cb7d33efaa92 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 11 Mar 2007 10:13:23 +0000 Subject: [PATCH] * fixed patch for #8480 git-svn-id: trunk@6783 - --- rtl/inc/wstrings.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rtl/inc/wstrings.inc b/rtl/inc/wstrings.inc index 414b12c03d..90ae521cc3 100644 --- a/rtl/inc/wstrings.inc +++ b/rtl/inc/wstrings.inc @@ -238,11 +238,11 @@ Procedure fpc_WideStr_Incr_Ref(Var S : Pointer);[Public,Alias:'FPC_WIDESTR_INCR_ exit; {$ifdef FPC_WINLIKEWIDESTRING} p:=NewWidestring(length(WideString(S))); - move(s^,p^,length(WideString(s)+1)*sizeof(widechar)); // double nul also + move(s^,p^,(length(WideString(s))+1)*sizeof(widechar)); // double #0 too s:=p; {$else FPC_WINLIKEWIDESTRING} { Let's be paranoid : Constant string ??} - If PWideRec(S-WideFirstOff)^.Ref<0 then + If PWideRec(S-WideFirstOff)^.Ref<0 then exit; inclocked(PWideRec(S-WideFirstOff)^.Ref); {$endif FPC_WINLIKEWIDESTRING} @@ -378,7 +378,7 @@ begin if S2<>nil then begin S1:=NewWidestring(length(WideString(S2))); - move(s2^,s1^,length(WideString(s1))*sizeof(widechar)); + move(s2^,s1^,(length(WideString(s1))+1)*sizeof(widechar)); end else S1:=nil;