From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [Patch 1/3] tabled: make time2str reentrant Date: Sun, 03 Jan 2010 16:27:51 -0500 Message-ID: <4B410BD7.4090702@garzik.org> References: <20100103005630.369b3c77@redhat.com> <4B40550F.5010907@garzik.org> <20100103013446.73b6df4a@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=VDYZryZhDgm1QRult9NXkAgjPz9q89Qbixdx0XbX3Jc=; b=BCZD5drwl4Hbn+9swWf/3jA5/qgnF3f1Lanat8tRihGk6qaQXp1wEcSw+mJmvv4Ip6 GxmKbzQDqSxdnzu6jvtFBjq4cNsfsMeZzXQ4RRTXNV8j07eWYhJVwuNuol7QtkSmSB8Y uOrWJw1hio252Jv+nn9ipNVk1iF5i9au1uYw4= In-Reply-To: <20100103013446.73b6df4a@redhat.com> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Pete Zaitcev Cc: Project Hail List On 01/03/2010 03:34 AM, Pete Zaitcev wrote: > On Sun, 03 Jan 2010 03:27:59 -0500 > Jeff Garzik wrote: > >>> - sprintf(datestr, "Date: %s", time2str(timestr, time(NULL))); >>> + sprintf(datestr, "Date: %s", time2str(timestr, 64, time(NULL))); >> >> applied 1-3, and then added sizeof() to the above time2str calls... The >> hardcoded sizes I used for the strings is ugly enough... let's not add >> additional "naked numbers" on top of that. > > I thought wrapping was worse. Sure... Cosmetically annoying, yes. But hardcoding string length in multiple locations increases the chances of an actual bug, so... Jeff