Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jan 2015 18:19:26 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r277841 - head/contrib/amd/hlfsd
Message-ID:  <201501281819.t0SIJQG4073269@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501281819.t0SIJQG4073269>