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
5bb94866
Commit
5bb94866
authored
Jun 22, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Nov 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Args.c: simplify options string allocation
parent
0755f3d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
18 deletions
+4
-18
Args.c
nx-X11/programs/Xserver/hw/nxagent/Args.c
+4
-18
No files found.
nx-X11/programs/Xserver/hw/nxagent/Args.c
View file @
5bb94866
...
...
@@ -277,32 +277,18 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
if
((
!
strcmp
(
argv
[
j
],
"-options"
)
||
!
strcmp
(
argv
[
j
],
"-option"
))
&&
j
+
1
<
argc
)
{
if
(
nxagentOptionsFilenameOrString
)
{
nxagentOptionsFilenameOrString
=
(
char
*
)
realloc
(
nxagentOptionsFilenameOrString
,
strlen
(
argv
[
j
+
1
])
+
1
);
}
else
{
nxagentOptionsFilenameOrString
=
(
char
*
)
malloc
(
strlen
(
argv
[
j
+
1
])
+
1
);
}
SAFE_free
(
nxagentOptionsFilenameOrString
);
if
(
nxagentOptionsFilenameOrString
!=
NULL
)
if
(
-
1
==
asprintf
(
&
nxagentOptionsFilenameOrString
,
"%s"
,
argv
[
j
+
1
])
)
{
nxagentOptionsFilenameOrString
=
strcpy
(
nxagentOptionsFilenameOrString
,
argv
[
j
+
1
]
);
FatalError
(
"malloc failed"
);
}
#ifdef WARNING
else
{
fprintf
(
stderr
,
"ddxProcessArgument: WARNING! failed string allocation.
\n
"
);
}
#endif
break
;
}
}
nxagentProcessOptions
(
nxagentOptionsFilenameOrString
);
}
}
/* if (resetOptions == True) */
if
(
!
strcmp
(
argv
[
i
],
"-B"
))
{
...
...
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