aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2018-01-03 00:59:20 +0100
committerUlrich Sibiller <uli42@gmx.de>2018-01-07 01:27:07 +0100
commit74c21e9e2dee66dcc3b5224081440fb2351e4d4c (patch)
tree4f2cff901afccacfd7a8c7b7a980796aec531726
parentdc61b6ccacb0cd535e125f6e3831c5d0b3d073b4 (diff)
downloadnx-libs-74c21e9e2dee66dcc3b5224081440fb2351e4d4c.tar.gz
nx-libs-74c21e9e2dee66dcc3b5224081440fb2351e4d4c.tar.bz2
nx-libs-74c21e9e2dee66dcc3b5224081440fb2351e4d4c.zip
Args.c, Error.[ch]: introduce own length macro for nxagentClientsLogName
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Args.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Error.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Error.h3
3 files changed, 6 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c
index 6c0160164..ee18f3b0d 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
@@ -1254,7 +1254,7 @@ static void nxagentParseOptions(char *name, char *value)
}
else if (strcmp(name, "clients") == 0)
{
- strcpy(nxagentClientsLogName, value);
+ snprintf(nxagentClientsLogName, NXAGENTCLIENTSLOGNAMELENGTH, "%s", value);
return;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.c b/nx-X11/programs/Xserver/hw/nxagent/Error.c
index 4493840d4..7abd83ae3 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Error.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c
@@ -78,7 +78,7 @@ static int nxagentClientsLog = -1;
* Clients log file name.
*/
-char nxagentClientsLogName[DEFAULT_STRING_LENGTH] = { 0 };
+char nxagentClientsLogName[NXAGENTCLIENTSLOGNAMELENGTH] = { 0 };
/*
* User's home.
@@ -591,7 +591,7 @@ void nxagentGetClientsPath()
return;
}
- if (strlen(sessionPath) + strlen("/clients") > DEFAULT_STRING_LENGTH - 1)
+ if (strlen(sessionPath) + strlen("/clients") > NXAGENTCLIENTSLOGNAMELENGTH - 1)
{
#ifdef PANIC
fprintf(stderr, "nxagentGetClientsPath: PANIC! Invalid value for the NX clients Log File Path ''.\n");
@@ -602,7 +602,7 @@ void nxagentGetClientsPath()
return;
}
- snprintf(nxagentClientsLogName, DEFAULT_STRING_LENGTH, "%s/clients", sessionPath);
+ snprintf(nxagentClientsLogName, NXAGENTCLIENTSLOGNAMELENGTH, "%s/clients", sessionPath);
free(sessionPath);
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.h b/nx-X11/programs/Xserver/hw/nxagent/Error.h
index 1d0d9a827..f23385e0a 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Error.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Error.h
@@ -30,7 +30,8 @@
* Clients log file name.
*/
-extern char nxagentClientsLogName[];
+#define NXAGENTCLIENTSLOGNAMELENGTH 256
+extern char nxagentClientsLogName[NXAGENTCLIENTSLOGNAMELENGTH];
extern char nxagentVerbose;