소스 검색

fcl-res: "Read version resource" fix. Last #0 char is special and should be excluded (#0 is implicitly added for string), even for toread<>-1 (TVersionResource.ReadWideString). Fix for bug #32603

git-svn-id: trunk@37685 -
maciej-izak 7 년 전
부모
커밋
d4acc80ba6
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      packages/fcl-res/src/versionresource.pp

+ 3 - 0
packages/fcl-res/src/versionresource.pp

@@ -327,6 +327,9 @@ begin
     inc(i);
   until i = toread;
   Result:=ws;
+  // last #0 should be excluded (#0 is implicitly added for string)
+  if (toread<>-1) and (Result[i] = #0) then
+    SetLength(Result, i-1);
 end;
 
 procedure TVersionResource.WriteFixedBlockLength(const position: int64);