* fhandler_socket.cc (fhandler_socket::recvfrom): Always initialize

ret to 0.
	(fhandler_socket::recvmsg): Ditto.
This commit is contained in:
Corinna Vinschen 2005-08-18 13:14:15 +00:00
parent d71805725f
commit abebe87c40
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2005-08-18 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::recvfrom): Always initialize
ret to 0.
(fhandler_socket::recvmsg): Ditto.
2005-08-18 Corinna Vinschen <corinna@vinschen.de>
* errno.cc (strerror): Check errnum for underflow.

View File

@ -1004,7 +1004,7 @@ fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
struct sockaddr *from, int *fromlen)
{
int res = SOCKET_ERROR;
DWORD ret;
DWORD ret = 0;
flags &= MSG_WINMASK;
if (!winsock2_active)
@ -1016,7 +1016,7 @@ fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
WSABUF wsabuf = { len, (char *) ptr };
if (is_nonblocking () || closed () || async_io ())
res = WSARecvFrom (get_socket (), &wsabuf, 1, (ret = 0, &ret),
res = WSARecvFrom (get_socket (), &wsabuf, 1, &ret,
(DWORD *) &flags, from, fromlen, NULL, NULL);
else
{
@ -1136,10 +1136,10 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot)
while (wsaptr != wsabuf);
}
DWORD ret;
DWORD ret = 0;
if (is_nonblocking () || closed () || async_io ())
res = WSARecvFrom (get_socket (), wsabuf, iovcnt, (ret = 0, &ret),
res = WSARecvFrom (get_socket (), wsabuf, iovcnt, &ret,
(DWORD *) &flags, from, fromlen, NULL, NULL);
else
{