From 4acff91db52bc732ab79fb5e5cf35ff3b98525a2 Mon Sep 17 00:00:00 2001 From: vincents Date: Mon, 2 Apr 2007 21:52:51 +0000 Subject: [PATCH] LCL: fixed big endian issue in TestFormStreamFormat (bug #8012) git-svn-id: trunk@10854 - --- lcl/lresources.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lcl/lresources.pp b/lcl/lresources.pp index 283bbe8c7a..609db297b7 100644 --- a/lcl/lresources.pp +++ b/lcl/lresources.pp @@ -2154,16 +2154,16 @@ end; function TestFormStreamFormat(Stream: TStream): TLRSStreamOriginalFormat; var Pos: TStreamSeekType; - Signature: Integer; + Signature: Array[1..4] of Char; begin Pos := Stream.Position; - Signature := 0; + Signature[1] := #0; // initialize, in case the stream is at its end Stream.Read(Signature, SizeOf(Signature)); Stream.Position := Pos; - if (Byte(Signature) = $FF) or (Signature = Integer(FilerSignature)) then + if (Signature[1] = #$FF) or (Signature = FilerSignature) then Result := sofBinary // text format may begin with "object", "inherited", or whitespace - else if Char(Signature) in ['o','O','i','I',' ',#13,#11,#9] then + else if Signature[1] in ['o','O','i','I',' ',#13,#11,#9] then Result := sofText else Result := sofUnknown;