wifi: refactor nm_wifi_utils_level_to_quality() not to assert

Apparantly, the assert might fail (on i386?). Unclear why that would possibly
happen. Anyway, replace the assert.
This commit is contained in:
Thomas Haller 2017-10-30 13:02:06 +01:00
parent 8cbb6d9e86
commit e3a582202f

View file

@ -777,10 +777,8 @@ nm_wifi_utils_level_to_quality (gint val)
val = 100 - (int) ((100.0 * (double) val) / 60.0);
} else {
/* Assume signal is a "quality" percentage */
val = CLAMP (val, 0, 100);
}
g_assert (val >= 0);
return (guint32) val;
return CLAMP (val, 0, 100);
}