The variables here are unsigned and as such, cannot have a negative value. Use == 0 instead of <= 0 to make this cleaner. Signed-off-by: Jouni Malinen <j@w1.fi>
@@ -214,7 +214,7 @@ dbus_bool_t set_network_properties(struct wpa_supplicant *wpa_s,
} else if (entry.type == DBUS_TYPE_STRING) {
if (should_quote_opt(entry.key)) {
size = os_strlen(entry.str_value);
- if (size <= 0)
+ if (size == 0)
goto error;
size += 3;
@@ -884,7 +884,7 @@ DBusMessage * wpas_dbus_iface_set_network(DBusMessage *message,
/* Zero-length option check */
size += 3; /* For quotes and terminator */
value = os_zalloc(size);
@@ -1685,7 +1685,7 @@ int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s)
#else /* CONFIG_NO_SCAN_PROCESSING */
struct os_reltime now;
- if (wpa_s->last_scan_res_used <= 0)
+ if (wpa_s->last_scan_res_used == 0)
return -1;
os_get_reltime(&now);