1
0
Fork 0

ram: Check for theoretical division by zero

This commit is contained in:
Aaron Marcher 2018-07-06 23:38:12 +02:00
parent fa7c266e2b
commit ab4f24a612

View file

@ -36,6 +36,10 @@
return NULL;
}
if (total == 0) {
return NULL;
}
return bprintf("%d", 100 * ((total - free) -
(buffers + cached)) / total);
}