aboutsummaryrefslogtreecommitdiff
path: root/fsbm.c
diff options
context:
space:
mode:
Diffstat (limited to 'fsbm.c')
-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;
}