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 /LoadAverageMeter.c | |
parent | 23c5b9ce3c50a7c7aaa9a5734cad50d12610d8d8 (diff) |
Save text buffer in Meter
Diffstat (limited to 'LoadAverageMeter.c')
-rw-r--r-- | LoadAverageMeter.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/LoadAverageMeter.c b/LoadAverageMeter.c index 0c7b8339..196cee9f 100644 --- a/LoadAverageMeter.c +++ b/LoadAverageMeter.c @@ -36,7 +36,7 @@ static const int High_attributes[] = { METER_VALUE_ERROR }; -static void LoadAverageMeter_updateValues(Meter* this, char* buffer, size_t size) { +static void LoadAverageMeter_updateValues(Meter* this) { Platform_getLoadAverage(&this->values[0], &this->values[1], &this->values[2]); // only show bar for 1min value @@ -54,7 +54,7 @@ static void LoadAverageMeter_updateValues(Meter* this, char* buffer, size_t size this->total = 2 * this->pl->cpuCount; } - xSnprintf(buffer, size, "%.2f/%.2f/%.2f", this->values[0], this->values[1], this->values[2]); + xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%.2f/%.2f/%.2f", this->values[0], this->values[1], this->values[2]); } static void LoadAverageMeter_display(const Object* cast, RichString* out) { @@ -68,7 +68,7 @@ static void LoadAverageMeter_display(const Object* cast, RichString* out) { RichString_appendAscii(out, CRT_colors[LOAD_AVERAGE_FIFTEEN], buffer); } -static void LoadMeter_updateValues(Meter* this, char* buffer, size_t size) { +static void LoadMeter_updateValues(Meter* this) { double five, fifteen; Platform_getLoadAverage(&this->values[0], &five, &fifteen); @@ -84,7 +84,7 @@ static void LoadMeter_updateValues(Meter* this, char* buffer, size_t size) { this->total = 2 * this->pl->cpuCount; } - xSnprintf(buffer, size, "%.2f", this->values[0]); + xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%.2f", this->values[0]); } static void LoadMeter_display(const Object* cast, RichString* out) { |