From owner-svn-src-all@FreeBSD.ORG Wed Jan 28 19:05:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95D6FC0C; Wed, 28 Jan 2015 19:05:03 +0000 (UTC) Received: from vlakno.cz (mail.vlakno.cz [91.217.96.224]) by mx1.freebsd.org (Postfix) with ESMTP id 5C66FD2D; Wed, 28 Jan 2015 19:05:02 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id D20E41DAC962; Wed, 28 Jan 2015 20:04:22 +0100 (CET) Date: Wed, 28 Jan 2015 20:04:22 +0100 From: Roman Divacky To: Dimitry Andric Subject: Re: svn commit: r277841 - head/contrib/amd/hlfsd Message-ID: <20150128190422.GA58164@vlakno.cz> References: <201501281819.t0SIJQG4073269@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201501281819.t0SIJQG4073269@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2015 19:05:03 -0000 Given that this is a contributed code - have you sent the fix upstream? Also, upstream seems to have newer versions of this... On Wed, Jan 28, 2015 at 06:19:26PM +0000, Dimitry Andric wrote: > Author: dim > Date: Wed Jan 28 18:19:25 2015 > New Revision: 277841 > URL: https://svnweb.freebsd.org/changeset/base/277841 > > Log: > Fix the following clang 3.6.0 warning in contrib/amd/hlfsd/homedir.c: > > contrib/amd/hlfsd/homedir.c:497:8: error: address of array 'buf' will > always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] > if (!buf || buf[0] == '\0') > ~^~~ > > In the affected function, 'buf' is declared as an array of char, so it > can never be null. Remove the unecessary check. > > Modified: > head/contrib/amd/hlfsd/homedir.c > > Modified: head/contrib/amd/hlfsd/homedir.c > ============================================================================== > --- head/contrib/amd/hlfsd/homedir.c Wed Jan 28 18:13:52 2015 (r277840) > +++ head/contrib/amd/hlfsd/homedir.c Wed Jan 28 18:19:25 2015 (r277841) > @@ -494,7 +494,7 @@ readent: > buf[0] = '\0'; > fgets(buf, 256, passwd_fp); > passwd_line++; > - if (!buf || buf[0] == '\0') > + if (buf[0] == '\0') > goto readent; > > /* read user name */