Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
7afda7f5
Commit
7afda7f5
authored
Jan 21, 2014
by
zed_0xff
Browse files
fix column shift on wrong megabytes format
see
http://0xff.me/htop_bug.png
parent
76a715ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Process.c
View file @
7afda7f5
...
...
@@ -294,11 +294,14 @@ void Process_getMaxPid() {
#define ONE_M (ONE_K * ONE_K)
#define ONE_G (ONE_M * ONE_K)
#define ONE_DECIMAL_K 1000
#define ONE_DECIMAL_M (ONE_DECIMAL_K * ONE_DECIMAL_K)
static
void
Process_humanNumber
(
Process
*
this
,
RichString
*
str
,
unsigned
long
number
)
{
char
buffer
[
11
];
int
len
;
if
(
number
>=
(
10
*
ONE_M
))
{
if
(
number
>=
(
100
*
ONE_M
))
{
if
(
number
>=
(
10
*
ONE_
DECIMAL_
M
))
{
if
(
number
>=
(
100
*
ONE_
DECIMAL_
M
))
{
len
=
snprintf
(
buffer
,
10
,
"%4ldG "
,
number
/
ONE_M
);
RichString_appendn
(
str
,
CRT_colors
[
LARGE_NUMBER
],
buffer
,
len
);
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment