Browse Source

* fixed fpc_shortstr_concat() in case the max length for the destination is
already smaller than the length of the first string (probably cannot
happen currently, but may be in the future as a result of optimizations)

git-svn-id: trunk@17886 -

Jonas Maebe 14 years ago
parent
commit
c5dfa9d354
1 changed files with 5 additions and 1 deletions
  1. 5 1
      rtl/inc/generic.inc

+ 5 - 1
rtl/inc/generic.inc

@@ -930,7 +930,11 @@ begin
   s1l:=length(s1);
   s2l:=length(s2);
   if s1l+s2l>high(dests) then
-    s2l:=high(dests)-s1l;
+    begin
+      if s1l>high(dests) then
+        s1l:=high(dests);
+      s2l:=high(dests)-s1l;
+    end;
   if @dests=@s1 then
     move(s2[1],dests[s1l+1],s2l)
   else