Skip to content

Commit

Permalink
Bug fix when parameter is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
TOMATO-ONE committed Aug 15, 2021
1 parent badc612 commit 7847b23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions libxrdp/xrdp_rdp.c
Expand Up @@ -50,6 +50,10 @@ xrdp_rdp_read_config(const char *xrdp_ini, struct xrdp_client_info *client_info)
char *tmp = NULL;
int tmp_length = 0;

client_info->xrdp_keyboard_overrides.type = -1;
client_info->xrdp_keyboard_overrides.subtype = -1;
client_info->xrdp_keyboard_overrides.layout = -1;

/* initialize (zero out) local variables: */
items = list_create();
items->auto_free = 1;
Expand Down
6 changes: 3 additions & 3 deletions libxrdp/xrdp_sec.c
Expand Up @@ -383,20 +383,20 @@ xrdp_load_keyboard_layout(struct xrdp_client_info *client_info)
client_info->keyboard_type, client_info->keyboard_subtype,
client_info->keylayout);

if (ko->type != 0)
if (ko->type != -1)
{
LOG(LOG_LEVEL_INFO, "overrode keyboard_type 0x%02X"
" with 0x%02X", client_info->keyboard_type, ko->type);
client_info->keyboard_type = ko->type;
}
if (ko->subtype != 0)
if (ko->subtype != -1)
{
LOG(LOG_LEVEL_INFO, "overrode keyboard_subtype 0x%02X"
" with 0x%02X", client_info->keyboard_subtype,
ko->subtype);
client_info->keyboard_subtype = ko->subtype;
}
if (ko->layout != 0)
if (ko->layout != -1)
{
LOG(LOG_LEVEL_INFO, "overrode keylayout 0x%08X"
" with 0x%08X", client_info->keylayout, ko->layout);
Expand Down

0 comments on commit 7847b23

Please sign in to comment.