aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2016-10-25 23:40:13 +0200
committerUlrich Sibiller <uli42@gmx.de>2016-11-08 07:33:48 +0100
commite52799d5ce5189387a90b9d44f421ae90d00175c (patch)
treee0d23b9faecd8584156e6ac7fb7a1733fea3cb1d /nx-X11/programs/Xserver
parent718c5b9f1d16732773e60bb688a76beea7cb1253 (diff)
downloadnx-libs-e52799d5ce5189387a90b9d44f421ae90d00175c.tar.gz
nx-libs-e52799d5ce5189387a90b9d44f421ae90d00175c.tar.bz2
nx-libs-e52799d5ce5189387a90b9d44f421ae90d00175c.zip
Keyboard.c: replace malloc/strcpy by str(n)dup
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
index 3dd8b0668..1529cd359 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
@@ -900,16 +900,10 @@ XkbError:
}
free_model = 1;
- model = malloc(i + 1);
-
- strncpy(model, nxagentKeyboard, i);
-
- model[i] = '\0';
+ model = strndup(nxagentKeyboard, i);
free_layout = 1;
- layout = malloc(strlen(&nxagentKeyboard[i + 1]) + 1);
-
- strcpy(layout, &nxagentKeyboard[i + 1]);
+ layout = strdup(&nxagentKeyboard[i + 1]);
/*
* There is no description for pc105 on Solaris.