From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 16:40:26 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FE461065670 for ; Wed, 23 Apr 2008 16:40:26 +0000 (UTC) (envelope-from mwm@mired.org) Received: from mired.org (student.mired.org [66.92.153.77]) by mx1.freebsd.org (Postfix) with ESMTP id 1C55F8FC19 for ; Wed, 23 Apr 2008 16:40:26 +0000 (UTC) (envelope-from mwm@mired.org) Received: (qmail 54657 invoked from network); 23 Apr 2008 12:39:04 -0400 Received: from unknown (HELO mbook-fbsd) (192.168.195.251) by 0 with SMTP; 23 Apr 2008 12:39:04 -0400 Date: Wed, 23 Apr 2008 12:40:23 -0400 From: Mike Meyer To: Simun Mikecin 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> Organization: Meyer Consulting X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.5; amd64-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 23 Apr 2008 16:52:43 +0000 Cc: hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 16:40:26 -0000 On Wed, 23 Apr 2008 09:06:44 -0700 (PDT) Simun Mikecin 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. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information.