mirror of
https://github.com/pikami/slstatus.git
synced 2024-12-12 21:25:42 +00:00
swap_perc: check for division by zero on obsd too
This commit is contained in:
parent
806815778f
commit
4bd234c7ef
@ -188,6 +188,10 @@
|
|||||||
|
|
||||||
getstats(&total, &used);
|
getstats(&total, &used);
|
||||||
|
|
||||||
|
if (total == 0) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return bprintf("%d%%", 100 * used / total);
|
return bprintf("%d%%", 100 * used / total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user