Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9b4e3718
Commit
9b4e3718
authored
Mar 19, 2024
by
Brendan Shanks
Committed by
Alexandre Julliard
Mar 28, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Replace sprintf with snprintf to avoid deprecation warnings on macOS.
parent
4e04b2d5
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
21 additions
and
20 deletions
+21
-20
change.c
server/change.c
+1
-1
directory.c
server/directory.c
+1
-1
fd.c
server/fd.c
+3
-3
mapping.c
server/mapping.c
+1
-1
process.c
server/process.c
+1
-1
procfs.c
server/procfs.c
+2
-2
ptrace.c
server/ptrace.c
+2
-2
registry.c
server/registry.c
+4
-3
trace.c
server/trace.c
+1
-1
unicode.c
server/unicode.c
+5
-5
No files found.
server/change.c
View file @
9b4e3718
...
...
@@ -726,7 +726,7 @@ static char *get_path_from_fd( int fd, int sz )
#ifdef linux
char
*
ret
=
malloc
(
32
+
sz
);
if
(
ret
)
s
printf
(
ret
,
"/proc/self/fd/%u"
,
fd
);
if
(
ret
)
s
nprintf
(
ret
,
32
+
sz
,
"/proc/self/fd/%u"
,
fd
);
return
ret
;
#elif defined(F_GETPATH)
char
*
ret
=
malloc
(
PATH_MAX
+
sz
);
...
...
server/directory.c
View file @
9b4e3718
...
...
@@ -320,7 +320,7 @@ static void create_session( unsigned int id )
release_object
(
dir_sessions
);
}
s
printf
(
id_strA
,
"%u"
,
id
);
s
nprintf
(
id_strA
,
sizeof
(
id_strA
)
,
"%u"
,
id
);
id_strW
=
ascii_to_unicode_str
(
id_strA
,
&
id_str
);
dir_id
=
create_directory
(
&
dir_sessions
->
obj
,
&
id_str
,
0
,
HASH_SIZE
,
NULL
);
dir_dosdevices
=
create_directory
(
&
dir_id
->
obj
,
&
dir_dosdevices_str
,
OBJ_PERMANENT
,
HASH_SIZE
,
NULL
);
...
...
server/fd.c
View file @
9b4e3718
...
...
@@ -465,7 +465,7 @@ const char *get_timeout_str( timeout_t timeout )
{
secs
=
-
timeout
/
TICKS_PER_SEC
;
nsecs
=
-
timeout
%
TICKS_PER_SEC
;
s
printf
(
buffer
,
"+%ld.%07ld"
,
secs
,
nsecs
);
s
nprintf
(
buffer
,
sizeof
(
buffer
)
,
"+%ld.%07ld"
,
secs
,
nsecs
);
}
else
/* absolute */
{
...
...
@@ -477,10 +477,10 @@ const char *get_timeout_str( timeout_t timeout )
secs
--
;
}
if
(
secs
>=
0
)
s
printf
(
buffer
,
"%x%08x (+%ld.%07ld)"
,
s
nprintf
(
buffer
,
sizeof
(
buffer
)
,
"%x%08x (+%ld.%07ld)"
,
(
unsigned
int
)(
timeout
>>
32
),
(
unsigned
int
)
timeout
,
secs
,
nsecs
);
else
s
printf
(
buffer
,
"%x%08x (-%ld.%07ld)"
,
s
nprintf
(
buffer
,
sizeof
(
buffer
)
,
"%x%08x (-%ld.%07ld)"
,
(
unsigned
int
)(
timeout
>>
32
),
(
unsigned
int
)
timeout
,
-
(
secs
+
1
),
TICKS_PER_SEC
-
nsecs
);
}
...
...
server/mapping.c
View file @
9b4e3718
...
...
@@ -292,7 +292,7 @@ static int make_temp_file( char name[16] )
value
+=
(
current_time
>>
16
)
+
current_time
;
for
(
i
=
0
;
i
<
0x8000
&&
fd
<
0
;
i
++
,
value
+=
7777
)
{
s
printf
(
name
,
"tmpmap-%08x"
,
value
);
s
nprintf
(
name
,
16
,
"tmpmap-%08x"
,
value
);
fd
=
open
(
name
,
O_RDWR
|
O_CREAT
|
O_EXCL
,
0600
);
}
return
fd
;
...
...
server/process.c
View file @
9b4e3718
...
...
@@ -1552,7 +1552,7 @@ DECL_HANDLER(get_process_vm_counters)
char
proc_path
[
32
],
line
[
256
];
unsigned
long
value
;
s
printf
(
proc_path
,
"/proc/%u/status"
,
process
->
unix_pid
);
s
nprintf
(
proc_path
,
sizeof
(
proc_path
)
,
"/proc/%u/status"
,
process
->
unix_pid
);
if
((
f
=
fopen
(
proc_path
,
"r"
)))
{
while
(
fgets
(
line
,
sizeof
(
line
),
f
))
...
...
server/procfs.c
View file @
9b4e3718
...
...
@@ -55,7 +55,7 @@ static int open_proc_as( struct process *process, int flags )
return
-
1
;
}
s
printf
(
buffer
,
"/proc/%u/as"
,
process
->
unix_pid
);
s
nprintf
(
buffer
,
sizeof
(
buffer
)
,
"/proc/%u/as"
,
process
->
unix_pid
);
if
((
fd
=
open
(
buffer
,
flags
))
==
-
1
)
{
if
(
errno
==
ENOENT
)
/* probably got killed */
...
...
@@ -75,7 +75,7 @@ static int open_proc_lwpctl( struct thread *thread )
if
(
thread
->
unix_pid
==
-
1
)
return
-
1
;
s
printf
(
buffer
,
"/proc/%u/lwp/%u/lwpctl"
,
thread
->
unix_pid
,
thread
->
unix_tid
);
s
nprintf
(
buffer
,
sizeof
(
buffer
)
,
"/proc/%u/lwp/%u/lwpctl"
,
thread
->
unix_pid
,
thread
->
unix_tid
);
if
((
fd
=
open
(
buffer
,
O_WRONLY
))
==
-
1
)
{
if
(
errno
==
ENOENT
)
/* probably got killed */
...
...
server/ptrace.c
View file @
9b4e3718
...
...
@@ -366,7 +366,7 @@ int read_process_memory( struct process *process, client_ptr_t ptr, data_size_t
char
procmem
[
24
];
int
fd
;
s
printf
(
procmem
,
"/proc/%u/mem"
,
process
->
unix_pid
);
s
nprintf
(
procmem
,
sizeof
(
procmem
)
,
"/proc/%u/mem"
,
process
->
unix_pid
);
if
((
fd
=
open
(
procmem
,
O_RDONLY
))
!=
-
1
)
{
ssize_t
ret
=
pread
(
fd
,
dest
,
size
,
ptr
);
...
...
@@ -467,7 +467,7 @@ int write_process_memory( struct process *process, client_ptr_t ptr, data_size_t
char
procmem
[
24
];
int
fd
;
s
printf
(
procmem
,
"/proc/%u/mem"
,
process
->
unix_pid
);
s
nprintf
(
procmem
,
sizeof
(
procmem
)
,
"/proc/%u/mem"
,
process
->
unix_pid
);
if
((
fd
=
open
(
procmem
,
O_WRONLY
))
!=
-
1
)
{
ssize_t
r
=
pwrite
(
fd
,
src
,
size
,
ptr
);
...
...
server/registry.c
View file @
9b4e3718
...
...
@@ -1831,15 +1831,16 @@ static int load_init_registry_from_file( const char *filename, struct key *key )
static
WCHAR
*
format_user_registry_path
(
const
struct
sid
*
sid
,
struct
unicode_str
*
path
)
{
char
buffer
[
7
+
11
+
11
+
11
*
ARRAY_SIZE
(
sid
->
sub_auth
)]
,
*
p
=
buffer
;
char
buffer
[
7
+
11
+
11
+
11
*
ARRAY_SIZE
(
sid
->
sub_auth
)];
unsigned
int
i
;
int
len
;
p
+=
sprintf
(
p
,
"User
\\
S-%u-%u"
,
sid
->
revision
,
len
=
snprintf
(
buffer
,
sizeof
(
buffer
)
,
"User
\\
S-%u-%u"
,
sid
->
revision
,
((
unsigned
int
)
sid
->
id_auth
[
2
]
<<
24
)
|
((
unsigned
int
)
sid
->
id_auth
[
3
]
<<
16
)
|
((
unsigned
int
)
sid
->
id_auth
[
4
]
<<
8
)
|
((
unsigned
int
)
sid
->
id_auth
[
5
])
);
for
(
i
=
0
;
i
<
sid
->
sub_count
;
i
++
)
p
+=
sprintf
(
p
,
"-%u"
,
sid
->
sub_auth
[
i
]
);
for
(
i
=
0
;
i
<
sid
->
sub_count
;
i
++
)
len
+=
snprintf
(
buffer
+
len
,
sizeof
(
buffer
)
-
len
,
"-%u"
,
sid
->
sub_auth
[
i
]
);
return
ascii_to_unicode_str
(
buffer
,
path
);
}
...
...
server/trace.c
View file @
9b4e3718
...
...
@@ -5645,7 +5645,7 @@ static const char *get_status_name( unsigned int status )
for
(
i
=
0
;
status_names
[
i
].
name
;
i
++
)
if
(
status_names
[
i
].
value
==
status
)
return
status_names
[
i
].
name
;
}
s
printf
(
buffer
,
"%x"
,
status
);
s
nprintf
(
buffer
,
sizeof
(
buffer
)
,
"%x"
,
status
);
return
buffer
;
}
...
...
server/unicode.c
View file @
9b4e3718
...
...
@@ -212,19 +212,19 @@ int dump_strW( const WCHAR *str, data_size_t len, FILE *f, const char escape[2]
if
(
*
str
>
127
)
/* hex escape */
{
if
(
len
>
1
&&
str
[
1
]
<
128
&&
isxdigit
((
char
)
str
[
1
]))
pos
+=
s
printf
(
pos
,
"
\\
x%04x"
,
*
str
);
pos
+=
s
nprintf
(
pos
,
sizeof
(
buffer
)
-
(
pos
-
buffer
)
,
"
\\
x%04x"
,
*
str
);
else
pos
+=
s
printf
(
pos
,
"
\\
x%x"
,
*
str
);
pos
+=
s
nprintf
(
pos
,
sizeof
(
buffer
)
-
(
pos
-
buffer
)
,
"
\\
x%x"
,
*
str
);
continue
;
}
if
(
*
str
<
32
)
/* octal or C escape */
{
if
(
escapes
[
*
str
]
!=
'.'
)
pos
+=
s
printf
(
pos
,
"
\\
%c"
,
escapes
[
*
str
]
);
pos
+=
s
nprintf
(
pos
,
sizeof
(
buffer
)
-
(
pos
-
buffer
)
,
"
\\
%c"
,
escapes
[
*
str
]
);
else
if
(
len
>
1
&&
str
[
1
]
>=
'0'
&&
str
[
1
]
<=
'7'
)
pos
+=
s
printf
(
pos
,
"
\\
%03o"
,
*
str
);
pos
+=
s
nprintf
(
pos
,
sizeof
(
buffer
)
-
(
pos
-
buffer
)
,
"
\\
%03o"
,
*
str
);
else
pos
+=
s
printf
(
pos
,
"
\\
%o"
,
*
str
);
pos
+=
s
nprintf
(
pos
,
sizeof
(
buffer
)
-
(
pos
-
buffer
)
,
"
\\
%o"
,
*
str
);
continue
;
}
if
(
*
str
==
'\\'
||
*
str
==
escape
[
0
]
||
*
str
==
escape
[
1
])
*
pos
++
=
'\\'
;
...
...
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