Browse Source

* Fix range check error (bug ID 37566)

git-svn-id: trunk@46414 -
michael 5 years ago
parent
commit
98d5654678
1 changed files with 4 additions and 1 deletions
  1. 4 1
      packages/fcl-passrc/src/paswrite.pp

+ 4 - 1
packages/fcl-passrc/src/paswrite.pp

@@ -198,11 +198,14 @@ procedure TPasWriter.AddLn(const s: string);
 
 Var
   L : String;
+  len : Integer;
 
 begin
   Add(s);
   L:=PostProcessLine(FCurrentLine);
-  Stream.Write(L[1],Length(L));
+  Len:=Length(L);
+  if Len>0 then
+    Stream.Write(L[1],Len);
   Stream.Write(FLineEnding[1],Length(FLineEnding));
   IsStartOfLine:=True;
   FCurrentLine:='';