@@ -451,8 +451,9 @@ void print_devname(enum output_type type, int ifindex)
"dev", "%s ", ifname);
}
-void print_size(char *buf, int len, __u32 sz)
+char *sprint_size(__u32 sz, char *buf)
{
+ const size_t len = SPRINT_BSIZE - 1;
double tmp = sz;
if (sz >= 1024*1024 && fabs(1024*1024*rint(tmp/(1024*1024)) - sz) < 1024)
@@ -461,11 +462,7 @@ void print_size(char *buf, int len, __u32 sz)
snprintf(buf, len, "%gKb", rint(tmp/1024));
else
snprintf(buf, len, "%ub", sz);
-}
-char *sprint_size(__u32 size, char *buf)
-{
- print_size(buf, SPRINT_BSIZE-1, size);
return buf;
}
@@ -84,7 +84,6 @@ int get_size_and_cell(unsigned int *size, int *cell_log, char *str);
int get_time(unsigned int *time, const char *str);
int get_linklayer(unsigned int *val, const char *arg);
-void print_size(char *buf, int len, __u32 size);
void print_qdisc_handle(char *buf, int len, __u32 h);
void print_time(char *buf, int len, __u32 time);
void print_linklayer(char *buf, int len, unsigned int linklayer);