Browse Source

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 years ago
parent
commit
d4acc80ba6
1 changed files with 3 additions and 0 deletions
  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);