all repos — slstatus @ 4bd234c7ef7224117a6e50eda4ce3184338daab1

my build of slstatus (tools.suckless.org/slstatus/)

swap_perc: check for division by zero on obsd too
Aaron Marcher me@drkhsh.at
Mon, 21 May 2018 00:02:33 +0200
commit

4bd234c7ef7224117a6e50eda4ce3184338daab1

parent

806815778fe75f13b569a1b5fe6d6d74a50c89ff

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M components/swap.ccomponents/swap.c

@@ -188,6 +188,10 @@ int total, used;

getstats(&total, &used); + if (total == 0) { + return NULL; + } + return bprintf("%d%%", 100 * used / total); }