aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Screen.c
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2018-01-07 01:29:13 +0100
committerMihai Moldovan <ionic@ionic.de>2018-01-07 01:29:13 +0100
commit5f9f744cd8497ac250717951512fa32d266a73a1 (patch)
treecb379a43f3775a032834cd816e6d41663970001c /nx-X11/programs/Xserver/hw/nxagent/Screen.c
parent3c81899718e3429e45381beaaba58d4886a5537c (diff)
parent23c36c2d2c0d1ea85c1b638d71267c28522c08cd (diff)
downloadnx-libs-5f9f744cd8497ac250717951512fa32d266a73a1.tar.gz
nx-libs-5f9f744cd8497ac250717951512fa32d266a73a1.tar.bz2
nx-libs-5f9f744cd8497ac250717951512fa32d266a73a1.zip
Merge branch 'uli42-pr/fix_strings' into 3.6.x
Attributes GH PR #567: https://github.com/ArcticaProject/nx-libs/pull/567
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Screen.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index dd0fa301d..69c50cdf3 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -1783,36 +1783,31 @@ N/A
if(nxagentX2go)
{
#ifdef TEST
- fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n",
+ fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window with id [%ld].\n",
(long int)nxagentDefaultWindows[pScreen->myNum]);
#endif
XClassHint hint;
- hint.res_name=malloc(strlen("X2GoAgent")+1);
- hint.res_class=malloc(strlen("X2GoAgent")+1);
- strcpy(hint.res_name,"X2GoAgent");
- strcpy(hint.res_class,"X2GoAgent");
- XSetClassHint(nxagentDisplay,nxagentDefaultWindows[pScreen->myNum],&hint);
+ hint.res_name = strdup("X2GoAgent");
+ hint.res_class = strdup("X2GoAgent");
+ XSetClassHint(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &hint);
free(hint.res_name);
free(hint.res_class);
}
else
{
#ifdef TEST
- fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n",
+ fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window with id [%ld].\n",
(long int)nxagentDefaultWindows[pScreen->myNum]);
#endif
XClassHint hint;
- hint.res_name=malloc(strlen("NXAgent")+1);
- hint.res_class=malloc(strlen("NXAgent")+1);
- strcpy(hint.res_name,"NXAgent");
- strcpy(hint.res_class,"NXAgent");
- XSetClassHint(nxagentDisplay,nxagentDefaultWindows[pScreen->myNum],&hint);
+ hint.res_name = strdup("NXAgent");
+ hint.res_class = strdup("NXAgent");
+ XSetClassHint(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &hint);
free(hint.res_name);
free(hint.res_class);
}
-
if (nxagentOption(Fullscreen))
{
nxagentFullscreenWindow = nxagentDefaultWindows[pScreen->myNum];
@@ -2549,9 +2544,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
}
else
{
- layout = malloc(strlen(&nxagentKeyboard[i + 1]) + 1);
-
- strcpy(layout, &nxagentKeyboard[i + 1]);
+ layout = strdup(&nxagentKeyboard[i + 1]);
}
}
@@ -3480,6 +3473,7 @@ FIXME: The port information is not used at the moment and produces a
in++;
local_buf[in]=pszReturnData[i-1];
+ /* "localhost:" */
strcat(local_buf,"6c6f63616c686f73743a");
in+=20;