Remove unnecessary NULL check from LOG_LEVEL handler
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 21 Aug 2015 17:02:10 +0000 (20:02 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 21 Aug 2015 21:22:12 +0000 (00:22 +0300)
cmd cannot be NULL here, so there is no need to check it before calling
os_strlen().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
hostapd/ctrl_iface.c
wpa_supplicant/ctrl_iface.c

index 835feb0..306c53c 100644 (file)
@@ -1992,7 +1992,7 @@ static int hostapd_ctrl_iface_log_level(struct hostapd_data *hapd, char *cmd,
                }
        }
 
-       if (cmd && os_strlen(cmd)) {
+       if (os_strlen(cmd)) {
                int level = str_to_debug_level(cmd);
                if (level < 0)
                        return -1;
index 4d4d51a..62375e1 100644 (file)
@@ -2168,7 +2168,7 @@ static int wpa_supplicant_ctrl_iface_log_level(struct wpa_supplicant *wpa_s,
                }
        }
 
-       if (cmd && os_strlen(cmd)) {
+       if (os_strlen(cmd)) {
                int level = str_to_debug_level(cmd);
                if (level < 0)
                        return -1;