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

>I'm slowly finishing BString (tests are a boooooooring thing to do, 
>although they are EXTREMELY USEFUL :))), but I have a question:

Very much agreed on *both* points. ;)

>BeOS R5 sometimes crashes if you pass a NULL pointer (for example, in 
>BString::FindFirst(const char *). How should we behave? Just return 
B_ERROR?

We should definitely handle bad parameters where possible and 
reasonable.  The correct error code to use is B_BAD_VALUE, which the 
BeBook specifically calls out for use when "[a]n illegal value was 
passed to the function."

e

Necessity is the plea for every infringement of human freedom. It is the 
argument of tyrants; it is the creed of slaves.
        -William Pitt, British prime-minister (1759-1806)


Other related posts: