Subject: Re: strlen on a NULL
From: [email-masked] (Fergus Henderson)

15 May 1998 16:45:58 -0700
Message-ID: <[email-masked]>
References: <H00000b00005bfcb@MHS>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
To: Michael Hirmke <[email-masked]>
Cc: [email-masked]

On 13-May-1998, Michael Hirmke <[email-masked]> wrote:
> Valery Fine [[email-masked]] wrote:
> 
> >On 12 May 98 at 13:42, [email-masked] wrote:
> >
> >> On NT your process may lie anywhere, but never in ZERO, Thus you are
> >> not permitted to read from adress NULL. (You are not allowed to
> >> snoop around in the interrupt vetors!)
> >
> >  Some int strlen(char *s) is started with
> >
> >  int strlen(char *s){
> >   if (s==0) return 0;
>                      ^
>                      *This is really incorrect behaviour* !

No, the behaviour in this case is UNDEFINED -- that means that
ANY behaviour is correct behaviour.

Of course, strlen() should be

	size_t strlen(const char *s)

not

	int strlen(char *s)

-- 
Fergus Henderson <[email-masked]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [email-masked]        |     -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".