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
5a8307a1
Commit
5a8307a1
authored
Sep 08, 2011
by
Hisham Muhammad
Browse files
Fix panel inconsistency that could lead to crashes. Closes #2422267.
parent
978019d3
Changes
1
Show whitespace changes
Inline
Side-by-side
Panel.c
View file @
5a8307a1
...
@@ -238,18 +238,11 @@ void Panel_setSelected(Panel* this, int selected) {
...
@@ -238,18 +238,11 @@ void Panel_setSelected(Panel* this, int selected) {
void
Panel_draw
(
Panel
*
this
,
bool
focus
)
{
void
Panel_draw
(
Panel
*
this
,
bool
focus
)
{
assert
(
this
!=
NULL
);
assert
(
this
!=
NULL
);
int
first
,
last
;
int
itemCount
=
Vector_size
(
this
->
items
);
int
itemCount
=
Vector_size
(
this
->
items
);
int
scrollH
=
this
->
scrollH
;
int
scrollH
=
this
->
scrollH
;
int
y
=
this
->
y
;
int
x
=
this
->
x
;
int
y
=
this
->
y
;
int
x
=
this
->
x
;
first
=
this
->
scrollV
;
int
first
=
this
->
scrollV
;
int
last
=
MIN
(
itemCount
,
this
->
scrollV
+
MIN
(
itemCount
,
this
->
h
));
if
(
this
->
h
>
itemCount
)
{
last
=
this
->
scrollV
+
itemCount
;
move
(
y
+
last
,
x
+
0
);
}
else
{
last
=
MIN
(
itemCount
,
this
->
scrollV
+
this
->
h
);
}
if
(
this
->
selected
<
first
)
{
if
(
this
->
selected
<
first
)
{
first
=
this
->
selected
;
first
=
this
->
selected
;
this
->
scrollV
=
first
;
this
->
scrollV
=
first
;
...
...
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