From: Andrei Otcheretianski Date: Wed, 28 Dec 2016 13:47:06 +0000 (+0200) Subject: P2P: Fix compilation warning in p2p_add_device() X-Git-Tag: hostap_2_7~1867 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbad185c13f42d166e422b307d362e1332de1934;p=thirdparty%2Fhostap.git P2P: Fix compilation warning in p2p_add_device() The address of msg.device_name array is obviously always true, and some compilers even warn about it. Signed-off-by: Andrei Otcheretianski --- diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 372e4abf7..65dd1a32d 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -822,8 +822,8 @@ int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int freq, } dev->info.level = level; - dev_name_changed = msg.device_name && - os_strcmp(dev->info.device_name, msg.device_name) != 0; + dev_name_changed = os_strncmp(dev->info.device_name, msg.device_name, + WPS_DEV_NAME_MAX_LEN) != 0; p2p_copy_wps_info(p2p, dev, 0, &msg);