MantisBT - lxdream
View Issue Details
0000067lxdreamGD-Rompublic2009-03-18 04:392009-03-24 04:35
efry 
nkeynes 
normalminoralways
resolvedfixed 
 
 
0000067: cdi bug x86_64 OS X
Hi Nathan,

I tried compiling lxdream with -arch x86_64 on OS X and I came across a bug with the cdi image loading code.

in cdi.c

The code to seek to the header_offset is broken for CDI_V35_ID

You need to cast to long when using a negative offset.

I changed the code to

    if( trail.cdi_version == CDI_V35_ID ) {
        fseek( f, -(long)trail.header_offset, SEEK_END );
    } else {
        fseek( f, trail.header_offset, SEEK_SET );
    }

which seemed to get it working again.

Regards,
Eric
No tags attached.
Issue History
2009-03-18 04:39efryNew Issue
2009-03-24 04:35nkeynesStatusnew => resolved
2009-03-24 04:35nkeynesResolutionopen => fixed
2009-03-24 04:35nkeynesAssigned To => nkeynes
2009-03-24 04:35nkeynesNote Added: 0000076

Notes
(0000076)
nkeynes   
2009-03-24 04:35   
Ouch that's subtle, and the compiler doesn't even have the grace to warn about the implicit conversion. Thanks for finding this. I've changed it as you suggested