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
5cc89986
Commit
5cc89986
authored
Feb 25, 2010
by
Hisham Muhammad
Browse files
never show nan%
parent
8f230920
Changes
1
Hide whitespace changes
Inline
Side-by-side
CPUMeter.c
View file @
5cc89986
...
@@ -64,6 +64,7 @@ static void CPUMeter_setValues(Meter* this, char* buffer, int size) {
...
@@ -64,6 +64,7 @@ static void CPUMeter_setValues(Meter* this, char* buffer, int size) {
this
->
type
->
items
=
3
;
this
->
type
->
items
=
3
;
cpu
=
MIN
(
100
.
0
,
MAX
(
0
.
0
,
(
this
->
values
[
0
]
+
this
->
values
[
1
]
+
this
->
values
[
2
])));
cpu
=
MIN
(
100
.
0
,
MAX
(
0
.
0
,
(
this
->
values
[
0
]
+
this
->
values
[
1
]
+
this
->
values
[
2
])));
}
}
if
(
isnan
(
cpu
))
cpu
=
0
.
0
;
snprintf
(
buffer
,
size
,
"%5.1f%%"
,
cpu
);
snprintf
(
buffer
,
size
,
"%5.1f%%"
,
cpu
);
}
}
...
...
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