Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Apr 2008 12:40:23 -0400
From:      Mike Meyer <mwm@mired.org>
To:        Simun Mikecin <numisemis@yahoo.com>
Cc:        hackers@freebsd.org
Subject:   Re: strdup(NULL) supposed to create SIGSEGV?
Message-ID:  <20080423124023.54ca505e@mbook-fbsd>
In-Reply-To: <293918.47889.qm@web36608.mail.mud.yahoo.com>
References:  <293918.47889.qm@web36608.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 23 Apr 2008 09:06:44 -0700 (PDT) Simun Mikecin <numisemis@yahoo.com> wrote:

> >If you're going to quote documents to support your ideas, it's probably
> >better to read them first.
> 
> My apologies. My fingers were faster than my mind. But this made me read it the way I should have
> done in the first place. And I see that it says:
> "A null pointer is returned if the new string cannot be created."
> 
> Does that also mean that a null pointer is returned if the input is a NULL pointer (cause in that
> case new string could not be created)?

Are you sure? I'd say that the act of returning a NULL pointer created
the not-really-a-string that was passed in.

    <mike

-- 
Mike Meyer <mwm@mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080423124023.54ca505e>