diff options
author | Mihai Moldovan <ionic@ionic.de> | 2016-11-08 08:00:44 +0100 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2016-11-08 08:00:44 +0100 |
commit | b1d3f2ca5552528c01eefce7e55c18c36965660d (patch) | |
tree | 546ee82fe70cf9af80dc80598fde106a0687de46 /nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | |
parent | 7b79e8d831a520624fd5e28be6da7c6ad3360c1a (diff) | |
parent | 2f2ade61a8823bad012737b2b388dcc168cccbbf (diff) | |
download | nx-libs-b1d3f2ca5552528c01eefce7e55c18c36965660d.tar.gz nx-libs-b1d3f2ca5552528c01eefce7e55c18c36965660d.tar.bz2 nx-libs-b1d3f2ca5552528c01eefce7e55c18c36965660d.zip |
Merge branch 'uli42-pr/keyboard_fixes' into arctica-3.6.x
Attributes GH PR #243: https://github.com/ArcticaProject/nx-libs/pull/243
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Reconnect.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index c20386ea1..65e2ae795 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -438,22 +438,14 @@ Bool nxagentReconnectSession(void) if (nxagentKeyboard != NULL) { - int size; - - size = strlen(nxagentKeyboard); - - if ((nxagentOldKeyboard = malloc(size + 1)) != NULL) + nxagentOldKeyboard = strndup(nxagentKeyboard, strlen(nxagentKeyboard)); + if (nxagentOldKeyboard == NULL) { - strncpy(nxagentOldKeyboard, nxagentKeyboard, size); - - nxagentOldKeyboard[size] = '\0'; + /* 0 means reconnection failed */ + return 0; } - } - if (nxagentKeyboard) - { free(nxagentKeyboard); - nxagentKeyboard = NULL; } |