ram: Check for theoretical division by zero
This commit is contained in:
1 parent
fa7c266e2b
commit
ab4f24a612
1 file changed
+4
@@ -36,6 +36,10 @@
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (total == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return bprintf("%d", 100 * ((total - free) -
|
||||
(buffers + cached)) / total);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user