summaryrefslogtreecommitdiffstats
path: root/NetworkIOMeter.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-10-06 13:13:16 +0200
committerBenBE <BenBE@geshi.org>2021-03-04 23:57:45 +0100
commit2d1042adb382aa95456beff31b40abb7196567a0 (patch)
tree29e1a48c2927ce887a777b20847efae16b73c977 /NetworkIOMeter.c
parent23c5b9ce3c50a7c7aaa9a5734cad50d12610d8d8 (diff)
Save text buffer in Meter
Diffstat (limited to 'NetworkIOMeter.c')
-rw-r--r--NetworkIOMeter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/NetworkIOMeter.c b/NetworkIOMeter.c
index 47605cd3..c0e1b06f 100644
--- a/NetworkIOMeter.c
+++ b/NetworkIOMeter.c
@@ -24,7 +24,7 @@ static uint32_t cached_rxp_diff;
static uint32_t cached_txb_diff;
static uint32_t cached_txp_diff;
-static void NetworkIOMeter_updateValues(Meter* this, char* buffer, size_t len) {
+static void NetworkIOMeter_updateValues(Meter* this) {
static uint64_t cached_last_update = 0;
struct timeval tv;
@@ -45,7 +45,7 @@ static void NetworkIOMeter_updateValues(Meter* this, char* buffer, size_t len) {
NetworkIOData data;
hasData = Platform_getNetworkIO(&data);
if (!hasData) {
- xSnprintf(buffer, len, "no data");
+ xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "no data");
return;
}
@@ -95,7 +95,7 @@ static void NetworkIOMeter_updateValues(Meter* this, char* buffer, size_t len) {
char bufferBytesReceived[12], bufferBytesTransmitted[12];
Meter_humanUnit(bufferBytesReceived, cached_rxb_diff, sizeof(bufferBytesReceived));
Meter_humanUnit(bufferBytesTransmitted, cached_txb_diff, sizeof(bufferBytesTransmitted));
- xSnprintf(buffer, len, "rx:%siB/s tx:%siB/s", bufferBytesReceived, bufferBytesTransmitted);
+ xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "rx:%siB/s tx:%siB/s", bufferBytesReceived, bufferBytesTransmitted);
}
static void NetworkIOMeter_display(ATTR_UNUSED const Object* cast, RichString* out) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy