#ifndef WX_PRECOMP
# include "wx/defs.h"
+# include "wx/palette.h"
#endif
#if wxUSE_STREAMS && wxUSE_GIF
{
m_pimage = m_pfirst;
- for (i = 1; i < which; i++)
+ for (i = 0; i < which; i++)
m_pimage = m_pimage->next;
return TRUE;
{
unsigned char buf[3];
- m_f->Read(buf, 3);
- m_f->SeekI(-3, wxFromCurrent);
+ if ( !m_f->Read(buf, WXSIZEOF(buf)) )
+ return FALSE;
+
+ m_f->SeekI(-(off_t)WXSIZEOF(buf), wxFromCurrent);
- return (memcmp(buf, "GIF", 3) == 0);
+ return memcmp(buf, "GIF", WXSIZEOF(buf)) == 0;
}