28 lines
1.2 KiB
Diff
28 lines
1.2 KiB
Diff
---
|
|
src/top/top.c | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
--- src/top/top.c
|
|
+++ src/top/top.c 2022-03-29 10:24:43.327490984 +0000
|
|
@@ -1684,9 +1684,9 @@ static inline const char *make_str_utf8
|
|
static const char *scale_mem (int target, float num, int width, int justr) {
|
|
// SK_Kb SK_Mb SK_Gb SK_Tb SK_Pb SK_Eb
|
|
#ifdef BOOST_MEMORY
|
|
- 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", "%.1f%c", "%.1f%c", "%.1f%c", "%.1f%c", NULL };
|
|
+ static const char *fmttab[] = { "%.0f", "%.1f%c", "%.1f%c", "%.1f%c", "%.1f%c", "%.1f%c", NULL };
|
|
#endif
|
|
static char buf[SMLBUFSIZ];
|
|
char *psfx;
|
|
@@ -1696,7 +1696,7 @@ static const char *scale_mem (int target
|
|
if (Rc.zero_suppress && 0 >= num)
|
|
goto end_justifies;
|
|
|
|
- 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], num, *psfx)))
|
|
goto end_justifies;
|