Skip to content

Commit

Permalink
Call character checking function with unsigned char
Browse files Browse the repository at this point in the history
  • Loading branch information
cgzones committed Sep 17, 2020
1 parent 1f5bd5c commit 8a849bc
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion AvailableColumnsPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static HandlerResult AvailableColumnsPanel_eventHandler(Panel* super, int ch) {
}
default:
{
if (ch < 255 && isalpha(ch))
if (0 < ch && ch < 255 && isalpha((unsigned char)ch))
result = Panel_selectByTyping(super, ch);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion CategoriesPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
break;
}
default:
if (ch < 255 && isalpha(ch))
if (0 < ch && ch < 255 && isalpha((unsigned char)ch))
result = Panel_selectByTyping(super, ch);
if (result == BREAK_LOOP)
result = IGNORED;
Expand Down
2 changes: 1 addition & 1 deletion ColumnsPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) {
}
default:
{
if (ch < 255 && isalpha(ch))
if (0 < ch && ch < 255 && isalpha((unsigned char)ch))
result = Panel_selectByTyping(super, ch);
if (result == BREAK_LOOP)
result = IGNORED;
Expand Down
2 changes: 1 addition & 1 deletion IncSet.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue
if (size == 0) return true;
IncMode_find(mode, panel, getPanelValue, 1);
doSearch = false;
} else if (ch < 255 && isprint((char)ch)) {
} else if (0 < ch && ch < 255 && isprint((unsigned char)ch)) {
if (mode->index < INCMODE_MAX) {
mode->buffer[mode->index] = ch;
mode->index++;
Expand Down
2 changes: 1 addition & 1 deletion MainPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) {
} else if (ch != ERR && ch > 0 && ch < KEY_MAX && this->keys[ch]) {
reaction |= (this->keys[ch])(this->state);
result = HANDLED;
} else if (isdigit(ch)) {
} else if (0 < ch && ch < 255 && isdigit((unsigned char)ch)) {
MainPanel_pidSearch(this, ch);
} else {
if (ch != ERR) {
Expand Down
2 changes: 1 addition & 1 deletion Panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ HandlerResult Panel_selectByTyping(Panel* this, int ch) {
this->eventHandlerState = xCalloc(100, sizeof(char));
char* buffer = this->eventHandlerState;

if (ch > 0 && ch < 255 && isalnum(ch)) {
if (0 < ch && ch < 255 && isalnum((unsigned char)ch)) {
int len = strlen(buffer);
if (len < 99) {
buffer[len] = ch;
Expand Down

0 comments on commit 8a849bc

Please sign in to comment.