[PATCH] P2P: Fix compilation warning in p2p_add_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The address of msg.device_name array is obviously always true, and some
compilers even warn about it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@xxxxxxxxx>
---
 src/p2p/p2p.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 372e4ab..65dd1a3 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);
 
-- 
1.9.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux