Explorar el Código

swap_perc: check for division by zero

master
Aaron Marcher hace 6 años
padre
commit
806815778f
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. +4
    -0
      components/swap.c

+ 4
- 0
components/swap.c Ver fichero

@@ -76,6 +76,10 @@
}
sscanf(match, "SwapFree: %ld kB\n", &free);

if (total == 0) {
return NULL;
}

return bprintf("%d%%", 100 * (total - free - cached) / total);
}



Cargando…
Cancelar
Guardar