[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc and mint-libs PL46



In <9506020816.AA03109@qnx.com>,
Chris Herborth (chrish@qnx.com) wrote:

>So, are you saying the _kernel_ should be checking for fopen( NULL, "r" )
>instead of the library?

Actually, in all likelyhood it's *not* the kernel that's crashing in
this case - it's the library function _unx2dos()!
(The kernel's Fopen() always runs in supervisor mode, and (char*)0 is
a completely valid address while in supervisor mode...)

>As a programmer, I'd rather have fopen fail, and _then_ figure out why,
>instead of checking the parameters before making the call.  That's (IMHO
>again) the more logical way of doing things.

I'd suggest to simply change _unx2dos() to return a null string
if NULL is passed as an input parameter - this should fix the problem
for all higher-level functions that deal with filenames...

-- 
 Martin Koehling | mk@anuurn.do.open.de | Martin_Koehling@un.maus.ruhr.de