Browse Source

ram: Check for theoretical division by zero

master
Aaron Marcher 8 years ago
parent
commit
ab4f24a612
  1. 4
      components/ram.c

4
components/ram.c

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

Loading…
Cancel
Save