codetools: fixed FileIsText, bug #18692

git-svn-id: trunk@29408 -
This commit is contained in:
mattias 2011-02-07 10:07:58 +00:00
parent 0c415f0a1d
commit 6c152e5c94

View File

@ -1141,8 +1141,8 @@ begin
try try
// read the first 1024 bytes // read the first 1024 bytes
Len:=1024; Len:=1024;
SetLength(Buf,1024+1); SetLength(Buf,Len+1);
Len:=fs.Read(Buf[1],length(Buf)); Len:=fs.Read(Buf[1],Len);
if Len>0 then begin if Len>0 then begin
Buf[Len+1]:=#0; Buf[Len+1]:=#0;
p:=PChar(Buf); p:=PChar(Buf);