Преглед изворни кода

swap_perc: check for division by zero

master
Aaron Marcher пре 6 година
родитељ
комит
806815778f
1 измењених фајлова са 4 додато и 0 уклоњено
  1. +4
    -0
      components/swap.c

+ 4
- 0
components/swap.c Прегледај датотеку

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

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

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



Loading…
Откажи
Сачувај