aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
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.