From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21822 invoked by alias); 26 Feb 2010 17:47:50 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27757 Received: (qmail 7446 invoked from network); 26 Feb 2010 17:47:49 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100226094731.ZM3981@torch.brasslantern.com> Date: Fri, 26 Feb 2010 09:47:31 -0800 In-reply-to: <201002261645.o1QGji9R022432@news01.csr.com> Comments: In reply to Peter Stephenson "Re: segfault in strftime" (Feb 26, 4:45pm) References: <20100226125256.GC13766@prunille.vinc17.org> <20100226150748.GE13766@prunille.vinc17.org> <20100226151712.05fbe555@news01> <20100226162130.GF13766@prunille.vinc17.org> <201002261645.o1QGji9R022432@news01.csr.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: segfault in strftime MIME-version: 1.0 Content-type: text/plain; charset=us-ascii [>workers] On Feb 26, 4:45pm, Peter Stephenson wrote: } Subject: Re: segfault in strftime } } Vincent Lefevre wrote: } > Wouldn't it be better to test only errno != 0 ? } } Well, given we're setting it to 0 beforehand that seems reasonable. That's *probably* safe in this case ... but in general I don't think so. The standards make no guarantee about the value of errno in the case where the library call returns "successfully" (however that may be defined) -- that is, the implementation is allowed to set errno to what the next upcoming error *might* be, and is not required to then clear errno before returning success.