0

[W521] false positive when SetString is used

dummzeuch 9 years ago updated by Lübbe Onken 9 years ago 1

The following code produces a W521: Return value of function xxx might be undefined:


function GetModuleFilename(const _Module: Cardinal): string;

var

Buffer: array[0..260] of Char;

begin

SetString(Result, Buffer, Windows.GetModuleFilename(_Module, Buffer, SizeOf(Buffer)))
end;

It should not.