Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
442a0d33
Commit
442a0d33
authored
10 years ago
by
Hisham Muhammad
Browse files
Options
Download
Email Patches
Plain Diff
Do not trust isalpha(c) for values > 255.
Fixes #174.
parent
1e0c530a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
AvailableColumnsPanel.c
+1
-1
AvailableColumnsPanel.c
CategoriesPanel.c
+1
-1
CategoriesPanel.c
ColumnsPanel.c
+1
-1
ColumnsPanel.c
IncSet.c
+1
-1
IncSet.c
Panel.c
+1
-1
Panel.c
RichString.c
+1
-1
RichString.c
htop.c
+1
-1
htop.c
with
7 additions
and
7 deletions
+7
-7
AvailableColumnsPanel.c
View file @
442a0d33
...
...
@@ -55,7 +55,7 @@ static HandlerResult AvailableColumnsPanel_eventHandler(Panel* super, int ch) {
}
default:
{
if
(
isalpha
(
ch
))
if
(
ch
<
255
&&
isalpha
(
ch
))
result
=
Panel_selectByTyping
(
super
,
ch
);
break
;
}
...
...
This diff is collapsed.
Click to expand it.
CategoriesPanel.c
View file @
442a0d33
...
...
@@ -102,7 +102,7 @@ static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
break
;
}
default:
if
(
isalpha
(
ch
))
if
(
ch
<
255
&&
isalpha
(
ch
))
result
=
Panel_selectByTyping
(
super
,
ch
);
if
(
result
==
BREAK_LOOP
)
result
=
IGNORED
;
...
...
This diff is collapsed.
Click to expand it.
ColumnsPanel.c
View file @
442a0d33
...
...
@@ -70,7 +70,7 @@ static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) {
}
default:
{
if
(
isalpha
(
ch
))
if
(
ch
<
255
&&
isalpha
(
ch
))
result
=
Panel_selectByTyping
(
super
,
ch
);
if
(
result
==
BREAK_LOOP
)
result
=
IGNORED
;
...
...
This diff is collapsed.
Click to expand it.
IncSet.c
View file @
442a0d33
...
...
@@ -153,7 +153,7 @@ bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue
}
}
doSearch
=
false
;
}
else
if
(
isprint
((
char
)
ch
)
&&
(
mode
->
index
<
INCMODE_MAX
))
{
}
else
if
(
ch
<
255
&&
isprint
((
char
)
ch
)
&&
(
mode
->
index
<
INCMODE_MAX
))
{
mode
->
buffer
[
mode
->
index
]
=
ch
;
mode
->
index
++
;
mode
->
buffer
[
mode
->
index
]
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Panel.c
View file @
442a0d33
...
...
@@ -427,7 +427,7 @@ HandlerResult Panel_selectByTyping(Panel* this, int ch) {
if
(
!
this
->
eventHandlerBuffer
)
this
->
eventHandlerBuffer
=
calloc
(
100
,
1
);
if
(
isalnum
(
ch
))
{
if
(
ch
<
255
&&
isalnum
(
ch
))
{
int
len
=
strlen
(
this
->
eventHandlerBuffer
);
if
(
len
<
99
)
{
this
->
eventHandlerBuffer
[
len
]
=
ch
;
...
...
This diff is collapsed.
Click to expand it.
RichString.c
View file @
442a0d33
...
...
@@ -128,7 +128,7 @@ static inline void RichString_writeFrom(RichString* this, int attrs, const char*
int
newLen
=
from
+
len
;
RichString_setLen
(
this
,
newLen
);
for
(
int
i
=
from
,
j
=
0
;
i
<
newLen
;
i
++
,
j
++
)
this
->
chptr
[
i
]
=
(
isprint
(
data_c
[
j
]
)
?
data_c
[
j
]
:
'?'
)
|
attrs
;
this
->
chptr
[
i
]
=
(
data_c
[
j
]
>=
32
?
data_c
[
j
]
:
'?'
)
|
attrs
;
this
->
chptr
[
newLen
]
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
htop.c
View file @
442a0d33
...
...
@@ -852,7 +852,7 @@ int main(int argc, char** argv) {
continue
;
}
if
(
isdigit
((
char
)
ch
))
{
if
(
ch
<
255
&&
isdigit
((
char
)
ch
))
{
if
(
Panel_size
(
panel
)
==
0
)
continue
;
pid_t
pid
=
ch
-
48
+
acc
;
for
(
int
i
=
0
;
i
<
ProcessList_size
(
pl
);
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help