Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
dc43f4c9
Commit
dc43f4c9
authored
Nov 18, 2017
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Error.c: simply nxagentGetClientsPath()
nxagentGetClientsPath() allocated and returned a string that was never used anywhere because it also fills the global variable with the same value.
parent
7e975e3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
31 deletions
+8
-31
Error.c
nx-X11/programs/Xserver/hw/nxagent/Error.c
+8
-31
No files found.
nx-X11/programs/Xserver/hw/nxagent/Error.c
View file @
dc43f4c9
...
@@ -98,7 +98,7 @@ static char nxagentRootDir[DEFAULT_STRING_LENGTH] = { 0 };
...
@@ -98,7 +98,7 @@ static char nxagentRootDir[DEFAULT_STRING_LENGTH] = { 0 };
static
char
nxagentSessionDir
[
DEFAULT_STRING_LENGTH
]
=
{
0
};
static
char
nxagentSessionDir
[
DEFAULT_STRING_LENGTH
]
=
{
0
};
char
*
nxagentGetClientsPath
(
void
);
void
nxagentGetClientsPath
(
void
);
static
int
nxagentPrintError
(
Display
*
dpy
,
XErrorEvent
*
event
,
FILE
*
fp
);
static
int
nxagentPrintError
(
Display
*
dpy
,
XErrorEvent
*
event
,
FILE
*
fp
);
...
@@ -247,16 +247,9 @@ int nxagentExitHandler(const char *message)
...
@@ -247,16 +247,9 @@ int nxagentExitHandler(const char *message)
void
nxagentOpenClientsLogFile
()
void
nxagentOpenClientsLogFile
()
{
{
char
*
clientsLogName
;
if
(
*
nxagentClientsLogName
==
'\0'
)
if
(
*
nxagentClientsLogName
==
'\0'
)
{
{
clientsLogName
=
nxagentGetClientsPath
();
nxagentGetClientsPath
();
if
(
clientsLogName
!=
NULL
)
{
free
(
clientsLogName
);
}
}
}
if
(
nxagentClientsLogName
!=
NULL
&&
*
nxagentClientsLogName
!=
'\0'
)
if
(
nxagentClientsLogName
!=
NULL
&&
*
nxagentClientsLogName
!=
'\0'
)
...
@@ -593,30 +586,27 @@ char *nxagentGetSessionPath(void)
...
@@ -593,30 +586,27 @@ char *nxagentGetSessionPath(void)
return
sessionPath
;
return
sessionPath
;
}
}
char
*
nxagentGetClientsPath
()
void
nxagentGetClientsPath
()
{
{
char
*
sessionPath
;
char
*
clientsPath
;
if
(
*
nxagentClientsLogName
==
'\0'
)
if
(
*
nxagentClientsLogName
==
'\0'
)
{
{
sessionPath
=
nxagentGetSessionPath
();
char
*
sessionPath
=
nxagentGetSessionPath
();
if
(
sessionPath
==
NULL
)
if
(
sessionPath
==
NULL
)
{
{
return
NULL
;
return
;
}
}
if
(
strlen
(
sessionPath
)
+
strlen
(
"/clients"
)
>
DEFAULT_STRING_LENGTH
-
1
)
if
(
strlen
(
sessionPath
)
+
strlen
(
"/clients"
)
>
DEFAULT_STRING_LENGTH
-
1
)
{
{
#ifdef PANIC
#ifdef PANIC
fprintf
(
stderr
,
"nxagentGetClientsPath: PANIC! Invalid value for the NX clients Log File Path '%s'.
\n
"
,
fprintf
(
stderr
,
"nxagentGetClientsPath: PANIC! Invalid value for the NX clients Log File Path ''.
\n
"
);
nxagentClientsLogName
);
#endif
#endif
free
(
sessionPath
);
free
(
sessionPath
);
return
NULL
;
return
;
}
}
strcpy
(
nxagentClientsLogName
,
sessionPath
);
strcpy
(
nxagentClientsLogName
,
sessionPath
);
...
@@ -626,19 +616,6 @@ char *nxagentGetClientsPath()
...
@@ -626,19 +616,6 @@ char *nxagentGetClientsPath()
free
(
sessionPath
);
free
(
sessionPath
);
}
}
clientsPath
=
malloc
(
strlen
(
nxagentClientsLogName
)
+
1
);
return
;
if
(
clientsPath
==
NULL
)
{
#ifdef PANIC
fprintf
(
stderr
,
"nxagentGetClientsPath: PANIC! Can't allocate memory for the clients Log File Path path.
\n
"
);
#endif
return
NULL
;
}
strcpy
(
clientsPath
,
nxagentClientsLogName
);
return
clientsPath
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment