Re: [hatari-devel] Re: Hatari SCSI Driver patch

[ Thread Index | Date Index | More Archives ]

Le 14/09/2015 21:31, Uwe Seimet a écrit :

Looks as if I have to take special care of cases where NULL pointers are
passed via NatFeats. How do I correctly check for NULL addresses in


take a look at natfeats.c for example :

static bool nf_name(Uint32 stack, Uint32 subid, Uint32 *retval)
        Uint32 ptr, len;
        const char *str;
        char *buf;

        ptr = STMemory_ReadLong(stack);
        len = STMemory_ReadLong(stack + SIZE_LONG);

so, you can access the value in 'stack' and do for example :

if ( ptr == 0x0 )
 /* value is null */
 /* value is not null */


Mail converted by MHonArc 2.6.19+