Commit 677da7fd authored by Ulrich Sibiller's avatar Ulrich Sibiller

Screen.c: string handling improvements

parent 9d5c83e2
...@@ -1783,36 +1783,31 @@ N/A ...@@ -1783,36 +1783,31 @@ N/A
if(nxagentX2go) if(nxagentX2go)
{ {
#ifdef TEST #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]); (long int)nxagentDefaultWindows[pScreen->myNum]);
#endif #endif
XClassHint hint; XClassHint hint;
hint.res_name=malloc(strlen("X2GoAgent")+1); hint.res_name = strdup("X2GoAgent");
hint.res_class=malloc(strlen("X2GoAgent")+1); hint.res_class = strdup("X2GoAgent");
strcpy(hint.res_name,"X2GoAgent"); XSetClassHint(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &hint);
strcpy(hint.res_class,"X2GoAgent");
XSetClassHint(nxagentDisplay,nxagentDefaultWindows[pScreen->myNum],&hint);
free(hint.res_name); free(hint.res_name);
free(hint.res_class); free(hint.res_class);
} }
else else
{ {
#ifdef TEST #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]); (long int)nxagentDefaultWindows[pScreen->myNum]);
#endif #endif
XClassHint hint; XClassHint hint;
hint.res_name=malloc(strlen("NXAgent")+1); hint.res_name = strdup("NXAgent");
hint.res_class=malloc(strlen("NXAgent")+1); hint.res_class = strdup("NXAgent");
strcpy(hint.res_name,"NXAgent"); XSetClassHint(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &hint);
strcpy(hint.res_class,"NXAgent");
XSetClassHint(nxagentDisplay,nxagentDefaultWindows[pScreen->myNum],&hint);
free(hint.res_name); free(hint.res_name);
free(hint.res_class); free(hint.res_class);
} }
if (nxagentOption(Fullscreen)) if (nxagentOption(Fullscreen))
{ {
nxagentFullscreenWindow = nxagentDefaultWindows[pScreen->myNum]; nxagentFullscreenWindow = nxagentDefaultWindows[pScreen->myNum];
...@@ -2549,9 +2544,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) ...@@ -2549,9 +2544,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
} }
else else
{ {
layout = malloc(strlen(&nxagentKeyboard[i + 1]) + 1); layout = strdup(&nxagentKeyboard[i + 1]);
strcpy(layout, &nxagentKeyboard[i + 1]);
} }
} }
...@@ -3480,6 +3473,7 @@ FIXME: The port information is not used at the moment and produces a ...@@ -3480,6 +3473,7 @@ FIXME: The port information is not used at the moment and produces a
in++; in++;
local_buf[in]=pszReturnData[i-1]; local_buf[in]=pszReturnData[i-1];
/* "localhost:" */
strcat(local_buf,"6c6f63616c686f73743a"); strcat(local_buf,"6c6f63616c686f73743a");
in+=20; in+=20;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment