summaryrefslogtreecommitdiff
path: root/components/netspeeds.c
diff options
context:
space:
mode:
Diffstat (limited to 'components/netspeeds.c')
-rw-r--r--components/netspeeds.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/components/netspeeds.c b/components/netspeeds.c
index b4e6972..6adc3ea 100644
--- a/components/netspeeds.c
+++ b/components/netspeeds.c
@@ -17,8 +17,11 @@
oldrxbytes = rxbytes;
- snprintf(path, sizeof(path),
- "/sys/class/net/%s/statistics/rx_bytes", interface);
+ if (esnprintf(path, sizeof(path),
+ "/sys/class/net/%s/statistics/rx_bytes",
+ interface) < 0) {
+ return NULL;
+ }
if (pscanf(path, "%llu", &rxbytes) != 1) {
return NULL;
}
@@ -37,8 +40,11 @@
oldtxbytes = txbytes;
- snprintf(path, sizeof(path),
- "/sys/class/net/%s/statistics/tx_bytes", interface);
+ if (esnprintf(path, sizeof(path),
+ "/sys/class/net/%s/statistics/tx_bytes",
+ interface) < 0) {
+ return NULL;
+ }
if (pscanf(path, "%llu", &txbytes) != 1) {
return NULL;
}