24 lines
1.2 KiB
Diff
24 lines
1.2 KiB
Diff
|
--- top/top.c
|
||
|
+++ top/top.c 2013-05-29 11:57:32.849439427 +0000
|
||
|
@@ -1496,9 +1496,9 @@ static inline const char *make_str (cons
|
||
|
static const char *scale_mem (int target, unsigned long num, int width, int justr) {
|
||
|
#ifndef NOBOOST_MEMS
|
||
|
// SK_Kb SK_Mb SK_Gb SK_Tb SK_Pb SK_Eb
|
||
|
- static const char *fmttab[] = { "%.0f", "%#.1f%c", "%#.3f%c", "%#.3f%c", "%#.3f%c", NULL };
|
||
|
+ static const char *fmttab[] = { "%.0f", "%#.1f%c", "%#.3f%c", "%#.3f%c", "%#.3f%c", "%#.3f%c", NULL };
|
||
|
#else
|
||
|
- static const char *fmttab[] = { "%.0f", "%.0f%c", "%.0f%c", "%.0f%c", "%.0f%c", NULL };
|
||
|
+ static const char *fmttab[] = { "%.0f", "%.0f%c", "%.0f%c", "%.0f%c", "%.0f%c", "%.0f%c", NULL };
|
||
|
#endif
|
||
|
static char buf[SMLBUFSIZ];
|
||
|
float scaled_num;
|
||
|
@@ -1510,7 +1510,7 @@ static const char *scale_mem (int target
|
||
|
goto end_justifies;
|
||
|
|
||
|
scaled_num = num;
|
||
|
- for (i = SK_Kb, psfx = Scaled_sfxtab; i < SK_Eb; psfx++, i++) {
|
||
|
+ for (i = SK_Kb, psfx = Scaled_sfxtab; i <= SK_Eb; psfx++, i++) {
|
||
|
if (i >= target
|
||
|
&& (width >= snprintf(buf, sizeof(buf), fmttab[i], scaled_num, *psfx)))
|
||
|
goto end_justifies;
|