References: <20190812134513.20758-1-arne@...1227...> <20190815121053.18433-1-arne@...1227...> From: Antonio Quartulli Message-ID: Date: Thu, 15 Aug 2019 14:11:24 +0200 MIME-Version: 1.0 In-Reply-To: <20190815121053.18433-1-arne@...1227...> Content-Language: en-US Subject: Re: [Openvpn-devel] [PATCH v2 1/2] Fix check if iface name is set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Arne Schwabe , openvpn-devel@lists.sourceforge.net Hi, On 15/08/2019 14:10, Arne Schwabe wrote: > Clang/Android complained > > warning: address of array 'rgi6->iface' will always evaluate to 'true' [-Wpointer-bool-conversion] > if (rgi6->iface) > > iface is a char[16]; So its pointer is always true. > > we do a CLEAR(rgi6) always before setting this struct and strcpy the > name into iface. So using strlen instead of checking for the pointer > should be the right fix. > > Patch V2: use if(strlen > 0) instead of if(strlen) > > Signed-off-by: Arne Schwabe Acked-by: Antonio Quartulli -- Antonio Quartulli