projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8068157
)
swap_perc: check for division by zero on obsd too
author
Aaron Marcher
<me@drkhsh.at>
Sun, 20 May 2018 22:02:33 +0000
(
00:02
+0200)
committer
Aaron Marcher
<me@drkhsh.at>
Sun, 20 May 2018 22:02:33 +0000
(
00:02
+0200)
components/swap.c
patch
|
blob
|
history
diff --git
a/components/swap.c
b/components/swap.c
index 465ffd4fc1f412f117a68517cc28bed5b655faf4..f5db66793ae2b5aabfe2883640aa89fc6ade3acd 100644
(file)
--- a/
components/swap.c
+++ b/
components/swap.c
@@
-188,6
+188,10
@@
getstats(&total, &used);
+ if (total == 0) {
+ return NULL;
+ }
+
return bprintf("%d%%", 100 * used / total);
}