aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
Diffstat (limited to 'procps')
-rw-r--r--procps/nmeter.c3
-rw-r--r--procps/powertop.c3
-rw-r--r--procps/ps.c9
-rw-r--r--procps/top.c3
4 files changed, 6 insertions, 12 deletions
diff --git a/procps/nmeter.c b/procps/nmeter.c
index 6a3b32743..5d5b83b8d 100644
--- a/procps/nmeter.c
+++ b/procps/nmeter.c
@@ -333,8 +333,7 @@ static void scale(ullong ul)
333 char buf[5]; 333 char buf[5];
334 334
335 /* see http://en.wikipedia.org/wiki/Tera */ 335 /* see http://en.wikipedia.org/wiki/Tera */
336 smart_ulltoa4(ul, buf, " kmgtpezy"); 336 smart_ulltoa4(ul, buf, " kmgtpezy")[0] = '\0';
337 buf[4] = '\0';
338 put(buf); 337 put(buf);
339} 338}
340 339
diff --git a/procps/powertop.c b/procps/powertop.c
index 71988a295..e3c29d1c3 100644
--- a/procps/powertop.c
+++ b/procps/powertop.c
@@ -627,7 +627,6 @@ static void show_timerstats(void)
627 int i, n = 0; 627 int i, n = 0;
628 char strbuf6[6]; 628 char strbuf6[6];
629 629
630 strbuf6[5] = '\0';
631 puts("\nTop causes for wakeups:"); 630 puts("\nTop causes for wakeups:");
632 for (i = 0; i < G.lines_cnt; i++) { 631 for (i = 0; i < G.lines_cnt; i++) {
633 if ((G.lines[i].count > 0 /*|| G.lines[i].disk_count > 0*/) 632 if ((G.lines[i].count > 0 /*|| G.lines[i].disk_count > 0*/)
@@ -639,7 +638,7 @@ static void show_timerstats(void)
639 /*char c = ' '; 638 /*char c = ' ';
640 if (G.lines[i].disk_count) 639 if (G.lines[i].disk_count)
641 c = 'D';*/ 640 c = 'D';*/
642 smart_ulltoa5(G.lines[i].count, strbuf6, " KMGTPEZY"); 641 smart_ulltoa5(G.lines[i].count, strbuf6, " KMGTPEZY")[0] = '\0';
643 printf(/*" %5.1f%% (%s)%c %s\n"*/ 642 printf(/*" %5.1f%% (%s)%c %s\n"*/
644 " %5.1f%% (%s) %s\n", 643 " %5.1f%% (%s) %s\n",
645 G.lines[i].count * 100.0 / G.lines_cumulative_count, 644 G.lines[i].count * 100.0 / G.lines_cumulative_count,
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
diff --git a/procps/top.c b/procps/top.c
index abee69806..a13a41cd8 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -847,8 +847,7 @@ static void display_topmem_header(int scr_width, int *lines_rem_p)
847static void ulltoa6_and_space(unsigned long long ul, char buf[6]) 847static void ulltoa6_and_space(unsigned long long ul, char buf[6])
848{ 848{
849 /* see http://en.wikipedia.org/wiki/Tera */ 849 /* see http://en.wikipedia.org/wiki/Tera */
850 smart_ulltoa5(ul, buf, " mgtpezy"); 850 smart_ulltoa5(ul, buf, " mgtpezy")[0] = '\0';
851 buf[5] = ' ';
852} 851}
853 852
854static NOINLINE void display_topmem_process_list(int lines_rem, int scr_width) 853static NOINLINE void display_topmem_process_list(int lines_rem, int scr_width)