From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [PATCH tabled] server/bucket.c: don't deref NULL upon failed malloc Date: Thu, 23 Sep 2010 15:32:04 -0400 Message-ID: <4C9BAB34.4080804@garzik.org> References: <8762xwybn1.fsf@meyering.net> <20100923080350.09e7dffc@lembas.zaitcev.lan> 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=gXBrASwDwRg9LJCmpom2HlTk4Nr4t3h3tQrctuL+DMI=; b=SqLxobNueI/Qqhr7vIAMdWcBvSjbGuoxg8Am1xHR29mwxcD7pX8bRKStnvWEr2gJYF 6cKFkDC0mzGglML7Pni5xGiYLqH4XU7YpnZvODI4+93VlPge/ONQgR9oPcDctNgbMduw JTWadAjCQY8h0uojATm6m6mvLg5LaCeau4VKs= In-Reply-To: <20100923080350.09e7dffc@lembas.zaitcev.lan> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Pete Zaitcev Cc: Jim Meyering , Project Hail On 09/23/2010 10:03 AM, Pete Zaitcev wrote: > On Thu, 23 Sep 2010 12:53:06 +0200 > Jim Meyering wrote: > >> I factored out the append_const definition to avoid >> having to wrap the long lines with the increased indentation. > >> p = s; >> >> +#define append_const(buf, c) \ >> + do { memcpy(buf, c, sizeof(c)-1); (buf) += sizeof(c)-1; } while (0) >> + >> tmpl = pfx_list; >> while (tmpl) { > > Dunno about Jeff, but I would definitely put an #undef to it > after the loop, just in case. Yeah, or after the function.