mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-02-03 01:00:34 +03:00
Check return value from FileRead (#663)
Co-authored-by: Max Halldén <me@maxhallden.com>
This commit is contained in:
parent
0fda7e39fe
commit
aab6d0d081
@ -48,6 +48,10 @@ namespace Steamworks
|
||||
fixed ( byte* ptr = buffer )
|
||||
{
|
||||
var readsize = Internal.FileRead( filename, (IntPtr)ptr, size );
|
||||
if ( readsize != size )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user