OSLib bug fixes (various)
Stewart Brodie
stewart.brodie at pace.co.uk
Fri Jan 12 16:52:26 GMT 2001
In message <lT3wsAAD3xX6EwcV at mk-net.demon.co.uk>
Tony van der Hoff <OSLib at mk-net.demon.co.uk> wrote:
> On Fri, 12 Jan 2001, at 12:31:48, Daniel Ellis <Daniel.Ellis at pace.co.uk>
> wrote on the subject "OSLib bug fixes (various)":
>
> >On Fri 12 Jan, Tony van der Hoff wrote:
> >>
> >> >+ Fixed null pointer dereferences in IndexHelp, BindHelp and DefMod -cstrong
> >> The SCL, at least, treats null pointers to a string argument to *printf
> >> the same as a pointer to a null string. However, I accept that this
> >> behaviour is not defined, so I guess your proposal makes it more
> >> portable.
> >
> > I'm not sure what you mean there. There's no check in the SCL for the
> > argument to printf being null. printf(0) gives oflaofla... and if zero
> > page (reading) is protected will cause a data abort.
> >
> What I mean is printf( "%s", NULL ) behaves the same way as printf( "%s",
> "" )
Not under RISC OS it doesn't - you get oflaoflaofla in the former case. Byte
0 of RAM is not a zero byte and the C library does not trap accesses to it.
--
Stewart Brodie, Senior Software Engineer (Views expressed are my own and
Pace Micro Technology PLC not those of my employer)
645 Newmarket Road
Cambridge, CB5 8PB, United Kingdom WWW: http://www.pacemicro.com/
More information about the oslib-user
mailing list