swap_perc: check for division by zero on obsd too
This commit is contained in:
1 parent
806815778f
commit
4bd234c7ef
1 file changed
+4
@@ -188,6 +188,10 @@
|
||||
|
||||
getstats(&total, &used);
|
||||
|
||||
if (total == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return bprintf("%d%%", 100 * used / total);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user