]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix compilation warning in p2p_add_device()
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Wed, 28 Dec 2016 13:47:06 +0000 (15:47 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 29 Dec 2016 22:49:24 +0000 (00:49 +0200)
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@intel.com>
src/p2p/p2p.c

index 372e4abf7f606a75425425670867017b9b028815..65dd1a32d210be8c4f575e12c14b0b0bf593363d 100644 (file)
@@ -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);