diff options
author | Nathan Scott <natoscott@users.noreply.github.com> | 2021-03-02 13:34:52 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-02 13:34:52 +1100 |
commit | 29570c01331591235ea44edc4983bfcae251c1fb (patch) | |
tree | 60845aab93225a19711365af2eb57e415b80e1a2 /linux/Platform.c | |
parent | 3fe297aa978e7e56de740422db50a03285ac9672 (diff) | |
parent | b4736228dca3767020bd29544ac0a44130e221fd (diff) |
Merge pull request #550 from natoscott/diskio-types
Fix integer sizing issues in the DiskIO Meter
Diffstat (limited to 'linux/Platform.c')
-rw-r--r-- | linux/Platform.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/linux/Platform.c b/linux/Platform.c index 00b8e309..8a4e27c7 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -494,12 +494,12 @@ bool Platform_getDiskIO(DiskIOData* data) { if (!fd) return false; - unsigned long int read_sum = 0, write_sum = 0, timeSpend_sum = 0; + unsigned long long int read_sum = 0, write_sum = 0, timeSpend_sum = 0; char lineBuffer[256]; while (fgets(lineBuffer, sizeof(lineBuffer), fd)) { char diskname[32]; - unsigned long int read_tmp, write_tmp, timeSpend_tmp; - if (sscanf(lineBuffer, "%*d %*d %31s %*u %*u %lu %*u %*u %*u %lu %*u %*u %lu", diskname, &read_tmp, &write_tmp, &timeSpend_tmp) == 4) { + unsigned long long int read_tmp, write_tmp, timeSpend_tmp; + if (sscanf(lineBuffer, "%*d %*d %31s %*u %*u %llu %*u %*u %*u %llu %*u %*u %llu", diskname, &read_tmp, &write_tmp, &timeSpend_tmp) == 4) { if (String_startsWith(diskname, "dm-")) continue; |