Commit 74c21e9e authored by Ulrich Sibiller's avatar Ulrich Sibiller

Args.c, Error.[ch]: introduce own length macro for nxagentClientsLogName

parent dc61b6cc
...@@ -1254,7 +1254,7 @@ static void nxagentParseOptions(char *name, char *value) ...@@ -1254,7 +1254,7 @@ static void nxagentParseOptions(char *name, char *value)
} }
else if (strcmp(name, "clients") == 0) else if (strcmp(name, "clients") == 0)
{ {
strcpy(nxagentClientsLogName, value); snprintf(nxagentClientsLogName, NXAGENTCLIENTSLOGNAMELENGTH, "%s", value);
return; return;
} }
......
...@@ -78,7 +78,7 @@ static int nxagentClientsLog = -1; ...@@ -78,7 +78,7 @@ static int nxagentClientsLog = -1;
* Clients log file name. * Clients log file name.
*/ */
char nxagentClientsLogName[DEFAULT_STRING_LENGTH] = { 0 }; char nxagentClientsLogName[NXAGENTCLIENTSLOGNAMELENGTH] = { 0 };
/* /*
* User's home. * User's home.
...@@ -591,7 +591,7 @@ void nxagentGetClientsPath() ...@@ -591,7 +591,7 @@ void nxagentGetClientsPath()
return; return;
} }
if (strlen(sessionPath) + strlen("/clients") > DEFAULT_STRING_LENGTH - 1) if (strlen(sessionPath) + strlen("/clients") > NXAGENTCLIENTSLOGNAMELENGTH - 1)
{ {
#ifdef PANIC #ifdef PANIC
fprintf(stderr, "nxagentGetClientsPath: PANIC! Invalid value for the NX clients Log File Path ''.\n"); fprintf(stderr, "nxagentGetClientsPath: PANIC! Invalid value for the NX clients Log File Path ''.\n");
...@@ -602,7 +602,7 @@ void nxagentGetClientsPath() ...@@ -602,7 +602,7 @@ void nxagentGetClientsPath()
return; return;
} }
snprintf(nxagentClientsLogName, DEFAULT_STRING_LENGTH, "%s/clients", sessionPath); snprintf(nxagentClientsLogName, NXAGENTCLIENTSLOGNAMELENGTH, "%s/clients", sessionPath);
free(sessionPath); free(sessionPath);
} }
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
* Clients log file name. * Clients log file name.
*/ */
extern char nxagentClientsLogName[]; #define NXAGENTCLIENTSLOGNAMELENGTH 256
extern char nxagentClientsLogName[NXAGENTCLIENTSLOGNAMELENGTH];
extern char nxagentVerbose; extern char nxagentVerbose;
......
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