浏览代码

* setlength finally fixed when l < length(s)

peter 26 年之前
父节点
当前提交
6c7989783f
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      rtl/inc/astrings.inc

+ 6 - 3
rtl/inc/astrings.inc

@@ -406,8 +406,8 @@ begin
           { Reallocation is needed... }
           Temp:=Pointer(NewAnsiString(L));
           if Length(S)>0 then
-            Move (Pointer(S)^,Temp^,Length(S)+1);
-          ansistr_decr_ref (Pointer(S));
+            Move(Pointer(S)^,Temp^,L);
+          ansistr_decr_ref(Pointer(S));
           Pointer(S):=Temp;
        end;
       { Force nil termination in case it gets shorter }
@@ -785,7 +785,10 @@ end;
 
 {
   $Log$
-  Revision 1.28  1999-06-09 23:00:16  peter
+  Revision 1.28.2.1  1999-06-14 00:39:07  peter
+    * setlength finally fixed when l < length(s)
+
+  Revision 1.28  1999/06/09 23:00:16  peter
     * small ansistring fixes
     * val_ansistr_sint destsize changed to longint
     * don't write low/hi ascii with -al