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
14a55891
Commit
14a55891
authored
Dec 27, 2017
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Loop.cpp: improve/fix usage of s(n)printf
parent
3066195d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Loop.cpp
nxcomp/src/Loop.cpp
+6
-4
No files found.
nxcomp/src/Loop.cpp
View file @
14a55891
...
...
@@ -3939,7 +3939,8 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
// this name cannot be changed as it is defined this way by the
// local X server
int
len
=
sprintf
(
unixSocketName
+
1
,
"/tmp/.X11-unix/X%d"
,
xPort
);
int
len
=
snprintf
(
unixSocketName
+
1
,
DEFAULT_STRING_LENGTH
-
1
,
"/tmp/.X11-unix/X%d"
,
xPort
);
unixSocketName
[
0
]
=
'\0'
;
sockaddr_un
*
xServerAddrABSTRACT
=
new
sockaddr_un
;
...
...
@@ -3977,7 +3978,7 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
char
unixSocketDir
[
DEFAULT_STRING_LENGTH
];
snprintf
(
unixSocketDir
,
DEFAULT_STRING_LENGTH
-
1
,
"/tmp/.X11-unix"
);
snprintf
(
unixSocketDir
,
DEFAULT_STRING_LENGTH
,
"/tmp/.X11-unix"
);
#ifdef __APPLE__
...
...
@@ -3990,7 +3991,7 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
*
slash
=
'\0'
;
}
snprintf
(
unixSocketDir
,
DEFAULT_STRING_LENGTH
-
1
,
"%s"
,
display
);
snprintf
(
unixSocketDir
,
DEFAULT_STRING_LENGTH
,
"%s"
,
display
);
}
#endif
...
...
@@ -4019,7 +4020,8 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
HandleCleanup
();
}
sprintf
(
unixSocketName
,
"%s/X%d"
,
unixSocketDir
,
xPort
);
snprintf
(
unixSocketName
,
DEFAULT_STRING_LENGTH
,
"%s/X%d"
,
unixSocketDir
,
xPort
);
#ifdef __APPLE__
...
...
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