diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2016-10-25 21:41:11 +0200 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-11-08 07:33:48 +0100 |
commit | 2f7f39b4987d6bb300d5f17145fdeb3054563009 (patch) | |
tree | 1a43cfc2b676d3c7f0b689cdfb0e484b2c601e09 /nx-X11/programs | |
parent | 8793e362b686985151d6174ee2f2a8e1bceb9ef5 (diff) | |
download | nx-libs-2f7f39b4987d6bb300d5f17145fdeb3054563009.tar.gz nx-libs-2f7f39b4987d6bb300d5f17145fdeb3054563009.tar.bz2 nx-libs-2f7f39b4987d6bb300d5f17145fdeb3054563009.zip |
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.
Diffstat (limited to 'nx-X11/programs')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 15 |
1 files 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); |