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
4f36cae4
Commit
4f36cae4
authored
Aug 27, 2005
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 27, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid using the obsolete inet_addr.
parent
6d94aa47
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
socket.c
dlls/winsock/socket.c
+3
-4
sock.c
dlls/winsock/tests/sock.c
+16
-5
No files found.
dlls/winsock/socket.c
View file @
4f36cae4
...
...
@@ -3815,7 +3815,7 @@ INT WINAPI WSAStringToAddressA(LPSTR AddressString,
LPINT
lpAddressLength
)
{
INT
res
=
0
;
LONG
inetaddr
;
struct
in_addr
inetaddr
;
LPSTR
workBuffer
=
NULL
,
ptrPort
;
TRACE
(
"(%s, %x, %p, %p, %p)
\n
"
,
AddressString
,
AddressFamily
,
lpProtocolInfo
,
...
...
@@ -3853,10 +3853,9 @@ INT WINAPI WSAStringToAddressA(LPSTR AddressString,
}
else
((
LPSOCKADDR_IN
)
lpAddress
)
->
sin_port
=
0
;
inetaddr
=
inet_addr
(
workBuffer
);
if
(
inetaddr
!=
INADDR_NONE
)
if
(
inet_aton
(
workBuffer
,
&
inetaddr
)
>
0
)
{
((
LPSOCKADDR_IN
)
lpAddress
)
->
sin_addr
.
WS_s_addr
=
inetaddr
;
((
LPSOCKADDR_IN
)
lpAddress
)
->
sin_addr
.
WS_s_addr
=
inetaddr
.
s_addr
;
res
=
0
;
}
else
...
...
dlls/winsock/tests/sock.c
View file @
4f36cae4
...
...
@@ -1210,9 +1210,12 @@ static void test_WSAStringToAddressA(void)
"WSAStringToAddressA() failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
len
=
sizeof
(
sockaddr
);
sockaddr
.
sin_port
=
0
;
sockaddr
.
sin_addr
.
s_addr
=
0
;
ret
=
WSAStringToAddressA
(
address3
,
AF_INET
,
NULL
,
(
SOCKADDR
*
)
&
sockaddr
,
&
len
);
ok
(
ret
,
"WSAStringToAddressA() succeeded unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
ok
(
!
ret
&&
sockaddr
.
sin_addr
.
s_addr
==
0xffffffff
,
"WSAStringToAddressA() failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
len
=
sizeof
(
sockaddr
);
sockaddr
.
sin_port
=
0
;
...
...
@@ -1223,9 +1226,12 @@ static void test_WSAStringToAddressA(void)
"WSAStringToAddressA() failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
len
=
sizeof
(
sockaddr
);
sockaddr
.
sin_port
=
0
;
sockaddr
.
sin_addr
.
s_addr
=
0
;
ret
=
WSAStringToAddressA
(
address5
,
AF_INET
,
NULL
,
(
SOCKADDR
*
)
&
sockaddr
,
&
len
);
ok
(
ret
,
"WSAStringToAddressA() succeeded unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
ok
(
!
ret
&&
sockaddr
.
sin_addr
.
s_addr
==
0xffffffff
&&
sockaddr
.
sin_port
==
0xffff
,
"WSAStringToAddressA() failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
}
static
void
test_WSAStringToAddressW
(
void
)
...
...
@@ -1257,7 +1263,6 @@ static void test_WSAStringToAddressW(void)
"WSAStringToAddressW() failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
len
=
sizeof
(
sockaddr
);
sockaddr
.
sin_port
=
0
;
sockaddr
.
sin_addr
.
s_addr
=
0
;
...
...
@@ -1266,9 +1271,12 @@ static void test_WSAStringToAddressW(void)
"WSAStringToAddressW() failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
len
=
sizeof
(
sockaddr
);
sockaddr
.
sin_port
=
0
;
sockaddr
.
sin_addr
.
s_addr
=
0
;
ret
=
WSAStringToAddressW
(
address3
,
AF_INET
,
NULL
,
(
SOCKADDR
*
)
&
sockaddr
,
&
len
);
ok
(
ret
,
"WSAStringToAddressW() failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
ok
(
!
ret
&&
sockaddr
.
sin_addr
.
s_addr
==
0xffffffff
,
"WSAStringToAddressW() failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
len
=
sizeof
(
sockaddr
);
sockaddr
.
sin_port
=
0
;
...
...
@@ -1279,9 +1287,12 @@ static void test_WSAStringToAddressW(void)
"WSAStringToAddressW() failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
len
=
sizeof
(
sockaddr
);
sockaddr
.
sin_port
=
0
;
sockaddr
.
sin_addr
.
s_addr
=
0
;
ret
=
WSAStringToAddressW
(
address5
,
AF_INET
,
NULL
,
(
SOCKADDR
*
)
&
sockaddr
,
&
len
);
ok
(
ret
,
"WSAStringToAddressW() succeeded unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
ok
(
!
ret
&&
sockaddr
.
sin_addr
.
s_addr
==
0xffffffff
&&
sockaddr
.
sin_port
==
0xffff
,
"WSAStringToAddressW() failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
}
/**************** Main program ***************/
...
...
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