mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-02-03 09:10:41 +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 )
|
fixed ( byte* ptr = buffer )
|
||||||
{
|
{
|
||||||
var readsize = Internal.FileRead( filename, (IntPtr)ptr, size );
|
var readsize = Internal.FileRead( filename, (IntPtr)ptr, size );
|
||||||
|
if ( readsize != size )
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user