Initializing layout of osk to avoid undefined behavior when changing keyboards.

This commit is contained in:
Pere Pujal i Carabantes 2021-12-12 01:52:19 +01:00
parent 7e9990a6d6
commit 7bc0e2c157

View file

@ -214,6 +214,18 @@ static struct osk_layout *load_layout(on_screen_keyboard * keyboard, char *layou
layout = malloc(sizeof(osk_layout));
layout->name = NULL;
layout->rows = NULL;
layout->width = 0;
layout->height = 0;
layout->fontpath = NULL;
layout->keys = NULL;
layout->keymap = NULL;
layout->composemap = NULL;
layout->keysymdefs = NULL;
layout->sizeofkeysymdefs = 0;
layout->bgcolor = def_bgcolor;
layout->fgcolor = def_fgcolor;
hlayout_loaded = 0;
#ifdef DEBUG
printf("load_layout %s\n", layout_name);