[interfacekit] Re: BString near completion.... but I have a question

"Erik Jaesler" <erik@xxxxxxxxxxxxxx> wrote:
> >BeOS R5 sometimes crashes if you pass a NULL pointer (for example, 
> > in 
> >BString::FindFirst(const char *). How should we behave=3F Just return 
> >B=5FERROR=3F
> We should definitely handle bad parameters where possible and 
> reasonable.  The correct error code to use is B=5FBAD=5FVALUE, which the 
> BeBook specifically calls out for use when "[a]n illegal value was 
> passed to the function."

Since the function returns an int32 and is supposed to return B=5FERROR 
if the character isn't found, I am not sure what to do... returning 
B=5FBAD=5FVALUE might break existing code - but then, if it passes a NULL 
pointer, it is already broken so we might be able to live with it :-)

Adios...
   Axel.



Other related posts: