swap_perc: check for division by zero on obsd too
Aaron Marcher me@drkhsh.at
Mon, 21 May 2018 00:02:33 +0200
1 files changed,
4 insertions(+),
0 deletions(-)
jump to
M
components/swap.c
→
components/swap.c
@@ -188,6 +188,10 @@ int total, used;
getstats(&total, &used); + if (total == 0) { + return NULL; + } + return bprintf("%d%%", 100 * used / total); }