Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
ram: fixed int overflow on pagetok macro
[slstatus.git]
/
components
/
netspeeds.c
diff --git
a/components/netspeeds.c
b/components/netspeeds.c
index
14b7799
..
7ab1590
100644
(file)
--- a/
components/netspeeds.c
+++ b/
components/netspeeds.c
@@
-29,8
+29,8
@@
return NULL;
}
return NULL;
}
- return fmt_human
_2((rxbytes - oldrxbytes) *
-
1000 / interval, "B/s"
);
+ return fmt_human
((rxbytes - oldrxbytes) * 1000 / interval,
+
1024
);
}
const char *
}
const char *
@@
-55,8
+55,8
@@
return NULL;
}
return NULL;
}
- return fmt_human
_2((txbytes - oldtxbytes) *
-
1000 / interval, "B/s"
);
+ return fmt_human
((txbytes - oldtxbytes) * 1000 / interval,
+
1024
);
}
#elif defined(__OpenBSD__)
#include <string.h>
}
#elif defined(__OpenBSD__)
#include <string.h>
@@
-97,8
+97,8
@@
return NULL;
}
return NULL;
}
- return fmt_human
_2((rxbytes - oldrxbytes) *
-
1000 / interval, "B/s"
);
+ return fmt_human
((rxbytes - oldrxbytes) * 1000 / interval,
+
1024
);
}
const char *
}
const char *
@@
-133,7
+133,7
@@
return NULL;
}
return NULL;
}
- return fmt_human
_2((txbytes - oldtxbytes) *
-
1000 / interval, "B/s"
);
+ return fmt_human
((txbytes - oldtxbytes) * 1000 / interval,
+
1024
);
}
#endif
}
#endif