diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-09-06 12:53:14 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-09-06 12:53:14 +0200 |
commit | a407cf74cc43c3cc26168e259cee469a4787a76c (patch) | |
tree | 2306029e1ea7b957825b55e3728d23c886da58dd /procps/ps.c | |
parent | d6ae4fb446daedfe3073d67be655942e9fa7eb18 (diff) | |
download | busybox-w32-a407cf74cc43c3cc26168e259cee469a4787a76c.tar.gz busybox-w32-a407cf74cc43c3cc26168e259cee469a4787a76c.tar.bz2 busybox-w32-a407cf74cc43c3cc26168e259cee469a4787a76c.zip |
Make smart_ulltoa return pointer to end (allows for code shink in callers)
function old new delta
smart_ulltoa5 405 408 +3
smart_ulltoa4 273 276 +3
list_table 1113 1114 +1
scale 36 34 -2
put_lu 55 53 -2
ulltoa6_and_space 19 14 -5
powertop_main 1470 1461 -9
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps/ps.c')
-rw-r--r-- | procps/ps.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/procps/ps.c b/procps/ps.c index 89cadad00..c65fa012a 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -299,8 +299,7 @@ static void put_lu(char *buf, int size, unsigned long u) | |||
299 | char buf4[5]; | 299 | char buf4[5]; |
300 | 300 | ||
301 | /* see http://en.wikipedia.org/wiki/Tera */ | 301 | /* see http://en.wikipedia.org/wiki/Tera */ |
302 | smart_ulltoa4(u, buf4, " mgtpezy"); | 302 | smart_ulltoa4(u, buf4, " mgtpezy")[0] = '\0'; |
303 | buf4[4] = '\0'; | ||
304 | sprintf(buf, "%.*s", size, buf4); | 303 | sprintf(buf, "%.*s", size, buf4); |
305 | } | 304 | } |
306 | 305 | ||
@@ -740,8 +739,7 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
740 | #endif | 739 | #endif |
741 | { | 740 | { |
742 | char buf6[6]; | 741 | char buf6[6]; |
743 | smart_ulltoa5(p->vsz, buf6, " mgtpezy"); | 742 | smart_ulltoa5(p->vsz, buf6, " mgtpezy")[0] = '\0'; |
744 | buf6[5] = '\0'; | ||
745 | #if ENABLE_FEATURE_PS_LONG | 743 | #if ENABLE_FEATURE_PS_LONG |
746 | if (opts & OPT_l) { | 744 | if (opts & OPT_l) { |
747 | char bufr[6], stime_str[6]; | 745 | char bufr[6], stime_str[6]; |
@@ -752,8 +750,7 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
752 | time_t start = now - elapsed; | 750 | time_t start = now - elapsed; |
753 | struct tm *tm = localtime(&start); | 751 | struct tm *tm = localtime(&start); |
754 | 752 | ||
755 | smart_ulltoa5(p->rss, bufr, " mgtpezy"); | 753 | smart_ulltoa5(p->rss, bufr, " mgtpezy")[0] = '\0'; |
756 | bufr[5] = '\0'; | ||
757 | 754 | ||
758 | if (p->tty_major == 136) | 755 | if (p->tty_major == 136) |
759 | /* It should be pts/N, not ptsN, but N > 9 | 756 | /* It should be pts/N, not ptsN, but N > 9 |