Warning fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-11-12 14:08:31 +00:00
parent 9777274a4a
commit 9386cb75e3
2 changed files with 6 additions and 6 deletions

View File

@@ -549,13 +549,14 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
wxFile file(dir + _T("horse.bmp"));
if ( file.IsOpened() )
{
size_t len = (size_t)file.Length();
void *data = malloc(len);
if ( file.Read(data, len) != len )
wxFileOffset len = file.Length();
size_t dataSize = (size_t)len;
void *data = malloc(dataSize);
if ( file.Read(data, dataSize) != len )
wxLogError(_T("Reading bitmap file failed"));
else
{
wxMemoryInputStream mis(data, len);
wxMemoryInputStream mis(data, dataSize);
if ( !image.LoadFile(mis) )
wxLogError(wxT("Can't load BMP image from stream"));
else