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
e33527b2
Commit
e33527b2
authored
Nov 30, 2016
by
Bruno Jesus
Committed by
Alexandre Julliard
Nov 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Simplify IPv4 sprintf.
Signed-off-by:
Bruno Jesus
<
00cpxxx@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fa172e1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
socket.c
dlls/ws2_32/socket.c
+12
-9
No files found.
dlls/ws2_32/socket.c
View file @
e33527b2
...
...
@@ -4368,13 +4368,14 @@ WS_u_short WINAPI WS_ntohs(WS_u_short netshort)
*/
char
*
WINAPI
WS_inet_ntoa
(
struct
WS_in_addr
in
)
{
unsigned
int
long_ip
=
ntohl
(
in
.
WS_s_addr
);
struct
per_thread_data
*
data
=
get_per_thread_data
();
sprintf
(
data
->
ntoa_buffer
,
"%u.%u.%u.%u"
,
(
unsigned
int
)(
ntohl
(
in
.
WS_s_addr
)
>>
24
&
0xff
)
,
(
unsigned
int
)(
ntohl
(
in
.
WS_s_addr
)
>>
16
&
0xff
)
,
(
unsigned
int
)(
ntohl
(
in
.
WS_s_addr
)
>>
8
&
0xff
)
,
(
unsigned
int
)(
ntohl
(
in
.
WS_s_addr
)
&
0xff
)
);
(
long_ip
>>
24
)
&
0xff
,
(
long_ip
>>
16
)
&
0xff
,
(
long_ip
>>
8
)
&
0xff
,
long_ip
&
0xff
);
return
data
->
ntoa_buffer
;
}
...
...
@@ -8289,18 +8290,20 @@ INT WINAPI WSAAddressToStringA( LPSOCKADDR sockaddr, DWORD len,
switch
(
sockaddr
->
sa_family
)
{
case
WS_AF_INET
:
{
unsigned
int
long_ip
=
ntohl
(((
SOCKADDR_IN
*
)
sockaddr
)
->
sin_addr
.
WS_s_addr
);
if
(
len
<
sizeof
(
SOCKADDR_IN
))
return
SOCKET_ERROR
;
sprintf
(
buffer
,
"%u.%u.%u.%u:%u"
,
(
unsigned
int
)(
ntohl
(
((
SOCKADDR_IN
*
)
sockaddr
)
->
sin_addr
.
WS_s_addr
)
>>
24
&
0xff
)
,
(
unsigned
int
)(
ntohl
(
((
SOCKADDR_IN
*
)
sockaddr
)
->
sin_addr
.
WS_s_addr
)
>>
16
&
0xff
)
,
(
unsigned
int
)(
ntohl
(
((
SOCKADDR_IN
*
)
sockaddr
)
->
sin_addr
.
WS_s_addr
)
>>
8
&
0xff
)
,
(
unsigned
int
)(
ntohl
(
((
SOCKADDR_IN
*
)
sockaddr
)
->
sin_addr
.
WS_s_addr
)
&
0xff
)
,
(
long_ip
>>
24
)
&
0xff
,
(
long_ip
>>
16
)
&
0xff
,
(
long_ip
>>
8
)
&
0xff
,
long_ip
&
0xff
,
ntohs
(
((
SOCKADDR_IN
*
)
sockaddr
)
->
sin_port
)
);
p
=
strchr
(
buffer
,
':'
);
if
(
!
((
SOCKADDR_IN
*
)
sockaddr
)
->
sin_port
)
*
p
=
0
;
break
;
}
case
WS_AF_INET6
:
{
struct
WS_sockaddr_in6
*
sockaddr6
=
(
LPSOCKADDR_IN6
)
sockaddr
;
...
...
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