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

12 May 1998 20:28:38 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
To: Ian Collins <[email-masked]>
Cc: gnuwin32 <[email-masked]>

On 12-May-1998, Ian Collins <[email-masked]> wrote:
> If I do a strlen on a NULL pointer I get a coredump.
> I have the same code running on a few *other* Unix machines with
> exhibiting this behaviour.
> OK, so I could tidy it up, but I wondered is this an oversight or the
> correct behaviour?

`strlen(NULL)' has UNDEFINED behaviour, so anything is correct.
A core dump is helpful as well as being correct.

You should fix your code.

-- 
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".