Hello,

I tryed the following in my XS module:

int Write1Byte(PerlIO* fh, long what)
{
        return PerlIO_write(fh, what, 1);
        // or return PerlIO_write(fh, (void*)what, 1);
}
With this I got a crash.

if I do this it works:
int Write1Byte(PerlIO* fh, long what)
{
        int i;
        char buf[1] = { '\0' };
        buf[0] = (char)what;
        i = PerlIO_write(fh, buf, 1);
        return i;
}

Can anyone tell me why?

Thank you,
Reinhard

Reply via email to