mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 23:13:00 +02:00
imageinfo_ni: avoid division by zero
Origin commit data
------------------
Branch: ni/coolstream
Commit: bad49da359
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2021-11-07 (Sun, 07 Nov 2021)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -549,7 +549,8 @@ int CImageInfoNI::CPU_Percent(_stat *cpu)
|
||||
|
||||
long unsigned int sys_diff = sys_new - sys_old;
|
||||
long unsigned int total_diff = total_new - total_old;
|
||||
|
||||
if(!total_diff)
|
||||
total_diff = 1;
|
||||
long unsigned int percent = ((float) sys_diff / (float) total_diff) * 100;
|
||||
|
||||
if (sys_diff > 1 || total_diff > 1)
|
||||
|
Reference in New Issue
Block a user