Browse Source

CompFunc: Fix buffer size in GetDisplayFilename.

jordanrussell 5 years ago
parent
commit
b97a33acb7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Projects/CompFunc.pas

+ 1 - 1
Projects/CompFunc.pas

@@ -93,7 +93,7 @@ function GetDisplayFilename(const Filename: String): String;
 var
   Buf: array[0..MAX_PATH-1] of Char;
 begin
-  if CommDlg.GetFileTitle(PChar(Filename), Buf, SizeOf(Buf)) = 0 then
+  if CommDlg.GetFileTitle(PChar(Filename), Buf, SizeOf(Buf) div SizeOf(Buf[0])) = 0 then
     Result := Buf
   else
     Result := Filename;