Fix for UBSAN error: left shift of negative value

This commit is contained in:
harry 2023-01-25 20:36:32 -05:00
parent 01821d89b5
commit b338d4a037
1 changed files with 3 additions and 3 deletions

View File

@ -315,9 +315,9 @@ FCEUFILE * FCEU_fopen(const char *path, const char *ipsfn, const char *mode, cha
{
uint32 magic;
magic = fp->fgetc();
magic|=fp->fgetc()<<8;
magic|=fp->fgetc()<<16;
magic = (fp->fgetc() & 0x00ff);
magic|= (fp->fgetc() & 0x00ff) << 8;
magic|= (fp->fgetc() & 0x00ff) << 16;
fp->fseek(0,SEEK_SET);
if(magic==0x088b1f) {