aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcalvin <calvin@it13.HOLTDOM.COM>2015-01-26 09:05:31 -0500
committercalvin <calvin@it13.HOLTDOM.COM>2015-01-26 09:05:31 -0500
commit38787b9c3111712d92b5b388b71e44900142ffa4 (patch)
tree40ed27211779ef1979f699741aed90d5e650bf9f
parente363f56cf5764ea424a0daf85baa2546e1b6ca94 (diff)
fix interface name error
-rw-r--r--fsbm.c6
1 files changed, 3 insertions, 3 deletions
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;
}