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
2836c72f
Commit
2836c72f
authored
Nov 24, 2017
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keyboard.c: replace malloc + strcpy by asprintf
parent
08912ef3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
Keyboard.c
nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+4
-6
No files found.
nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
View file @
2836c72f
...
...
@@ -1899,18 +1899,16 @@ void nxagentKeycodeConversionSetup(void)
char
*
sessionpath
=
nxagentGetSessionPath
();
if
(
sessionpath
)
{
int
keyboard_file_path_size
=
strlen
(
sessionpath
)
+
strlen
(
"/keyboard"
);
char
*
keyboard_file_path
=
malloc
((
keyboard_file_path_size
+
1
)
*
sizeof
(
char
));
char
*
keyboard_file_path
=
NULL
;
FILE
*
keyboard_file
;
if
(
!
keyboard_file_path
)
if
(
(
asprintf
(
&
keyboard_file_path
,
"%s/keyboard"
,
sessionpath
)
==
-
1
)
)
{
free
(
sessionpath
);
FatalError
(
"malloc for keyboard file path failed."
);
}
strcpy
(
keyboard_file_path
,
sessionpath
);
strcat
(
keyboard_file_path
,
"/keyboard"
);
free
(
sessionpath
);
if
((
keyboard_file
=
fopen
(
keyboard_file_path
,
"w"
)))
{
if
((
keyboard_file
=
fopen
(
keyboard_file_path
,
"w"
)))
{
if
(
drules
)
fprintf
(
keyboard_file
,
"rules=
\"
%s
\"\n
"
,
drules
[
0
]
==
'\0'
?
","
:
drules
);
if
(
dmodel
)
...
...
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