diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-10-06 13:13:16 +0200 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-03-04 23:57:45 +0100 |
commit | 2d1042adb382aa95456beff31b40abb7196567a0 (patch) | |
tree | 29e1a48c2927ce887a777b20847efae16b73c977 /DiskIOMeter.c | |
parent | 23c5b9ce3c50a7c7aaa9a5734cad50d12610d8d8 (diff) |
Save text buffer in Meter
Diffstat (limited to 'DiskIOMeter.c')
-rw-r--r-- | DiskIOMeter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/DiskIOMeter.c b/DiskIOMeter.c index 1be40aa6..dde007ed 100644 --- a/DiskIOMeter.c +++ b/DiskIOMeter.c @@ -30,7 +30,7 @@ static uint32_t cached_read_diff; static uint32_t cached_write_diff; static double cached_utilisation_diff; -static void DiskIOMeter_updateValues(Meter* this, char* buffer, size_t len) { +static void DiskIOMeter_updateValues(Meter* this) { static uint64_t cached_last_update; struct timeval tv; @@ -52,7 +52,7 @@ static void DiskIOMeter_updateValues(Meter* this, char* buffer, size_t len) { hasData = Platform_getDiskIO(&data); if (!hasData) { this->values[0] = 0; - xSnprintf(buffer, len, "no data"); + xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "no data"); return; } @@ -89,7 +89,7 @@ static void DiskIOMeter_updateValues(Meter* this, char* buffer, size_t len) { char bufferRead[12], bufferWrite[12]; Meter_humanUnit(bufferRead, cached_read_diff, sizeof(bufferRead)); Meter_humanUnit(bufferWrite, cached_write_diff, sizeof(bufferWrite)); - snprintf(buffer, len, "%sB %sB %.1f%%", bufferRead, bufferWrite, cached_utilisation_diff); + snprintf(this->txtBuffer, sizeof(this->txtBuffer), "%sB %sB %.1f%%", bufferRead, bufferWrite, cached_utilisation_diff); } static void DiskIOMeter_display(ATTR_UNUSED const Object* cast, RichString* out) { |