From owner-svn-src-head@freebsd.org Thu Dec 7 22:50:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEBBAE9350D; Thu, 7 Dec 2017 22:50:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id E97857A39F; Thu, 7 Dec 2017 22:50:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 540AED66025; Fri, 8 Dec 2017 09:50:23 +1100 (AEDT) Date: Fri, 8 Dec 2017 09:50:22 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Johnston cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326658 - head/lib/libefivar In-Reply-To: <201712071516.vB7FGHuT069830@repo.freebsd.org> Message-ID: <20171208093703.Q1048@besplex.bde.org> References: <201712071516.vB7FGHuT069830@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=zFx5VP3w1OfopxCF-z4A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Dec 2017 22:50:32 -0000 On Thu, 7 Dec 2017, Mark Johnston wrote: > Log: > Ensure that "out" is initialized in all error paths. > ... > Modified: head/lib/libefivar/efivar-dp-xlate.c > ============================================================================== > --- head/lib/libefivar/efivar-dp-xlate.c Thu Dec 7 09:05:34 2017 (r326657) > +++ head/lib/libefivar/efivar-dp-xlate.c Thu Dec 7 15:16:17 2017 (r326658) > @@ -529,7 +529,7 @@ build_dp(const char *efimedia, const char *relpath, ef > { > char *fp, *dptxt = NULL; > int rv = 0; > - efidp out; > + efidp out = NULL; > size_t len; > > fp = path_to_file_dp(relpath); This is a worse style of initializations in declararations than usual. 1 initialization in a non-declaration is mixed with many initializations in declarations, using the C99 misfeature of allowing initialiations after statements, without even any blank lines to keep the declarations separate. Most libefivar code is much uglier than this, with 2-space indentation and worse. Bruce