From 2f2a8ee008e2f90c4791eaeec6c86b42919cf9f7 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sun, 1 Sep 2019 15:41:03 +0200 Subject: Init.c: some scope improvements --- nx-X11/programs/Xserver/hw/nxagent/Init.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'nx-X11/programs/Xserver/hw') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index 0919a695f..a7338e49f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -221,15 +221,6 @@ void checkX2goAgent(void) void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) { - char *authority; - int i; - - #ifdef __sun - - char *environment; - - #endif - /* * Print our pid and version information. */ @@ -295,11 +286,13 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) } #endif - if ((authority = getenv("NX_XAUTHORITY"))) + char *authority = getenv("NX_XAUTHORITY"); + + if (authority) { #ifdef __sun - environment = malloc(15 + strlen(authority)); + char *environment = malloc(15 + strlen(authority)); sprintf(environment, "XAUTHORITY=%s", authority); @@ -391,7 +384,7 @@ FIXME: These variables, if not removed at all because have probably nxagentNumScreens = 1; } - for (i = 0; i < nxagentNumScreens; i++) + for (int i = 0; i < nxagentNumScreens; i++) { AddScreen(nxagentOpenScreen, argc, argv); } -- cgit v1.2.3