From 38787b9c3111712d92b5b388b71e44900142ffa4 Mon Sep 17 00:00:00 2001 From: calvin Date: Mon, 26 Jan 2015 09:05:31 -0500 Subject: fix interface name error --- fsbm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fsbm.c') diff --git a/fsbm.c b/fsbm.c index ad58174..ada40b8 100644 --- a/fsbm.c +++ b/fsbm.c @@ -32,7 +32,7 @@ void endHandler(int signum) { } void print_bps(double bytesPerSecond) { - const char* prefixes[] = { "", "k", "M", "G", "T", "P", "E", "Z", "Y" }; + const char* prefixes[] = { "b", "k", "M", "G", "T", "P", "E", "Z", "Y" }; double value; const char* unit; unsigned prefix = 0; @@ -98,7 +98,7 @@ void print_stats() { len = name - buf; // Parse the statistics, alls well, then get this shit going, otherwise f it. - if(sscanf(stats, "%Lu %*Lu %*Lu %*Lu %*Lu %*Lu %*Lu %*Lu %Lu", + if(sscanf(stats, "%Lu %*u %*u %*u %*u %*u %*u %*u %Lu", &rx_bytes, &tx_bytes) == 2) { size_t i = 0; @@ -108,7 +108,7 @@ void print_stats() { } for(i = 0; i < no_iface; i++) { // if it exists in our interfaces, great. reuse the iface struct - if(strncmp(name, interfaces[i].interface, len) == 0) { + if(strcmp(name, interfaces[i].interface) == 0) { found = true; break; } -- cgit v1.2.3