From 2f7f39b4987d6bb300d5f17145fdeb3054563009 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 25 Oct 2016 21:41:11 +0200 Subject: Keyboard.c: Fix and simplify keyboard config file handling keyboard config file for nxagent/x2goagent was broken from the moment it got implemented. nxagentXkbConfigFilePath had never been filled. --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 3bb363b47..7df4ce838 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -871,8 +871,6 @@ XkbError: FILE *file; XkbConfigRtrnRec config; - int nxagentXkbConfigFilePathSize; - char *nxagentXkbConfigFilePath; XkbComponentNamesRec names; @@ -1019,22 +1017,15 @@ XkbError: XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb); if (nxagentX2go) - nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_X2GO); + nxagentXkbConfigFilePath = strdup(XKB_CONFIG_FILE_X2GO); else - nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_NX); - - nxagentXkbConfigFilePath = malloc((nxagentXkbConfigFilePathSize + 1) * sizeof(char)); + nxagentXkbConfigFilePath = strdup(XKB_CONFIG_FILE_NX); - if ( nxagentXkbConfigFilePath == NULL) + if (nxagentXkbConfigFilePath == NULL) { FatalError("nxagentKeyboardProc: malloc failed."); } - if (nxagentX2go) - nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_X2GO); - else - nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_NX); - #ifdef TEST fprintf(stderr, "nxagentKeyboardProc: nxagentXkbConfigFilePath [%s].\n", nxagentXkbConfigFilePath); -- cgit v1.2.3