Module: wine Branch: master Commit: 567e21e13255f24cf6318024c93be94180ad7b2b URL: http://source.winehq.org/git/wine.git/?a=commit;h=567e21e13255f24cf6318024c9...
Author: Hans Leidekker hans@codeweavers.com Date: Wed Sep 3 12:29:45 2008 +0200
winhttp: Avoid testing errno when it isn't set.
---
dlls/winhttp/net.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index d367723..90950cb 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -524,9 +524,10 @@ BOOL netconn_get_next_line( netconn_t *conn, char *buffer, DWORD *buflen ) { if (poll( &pfd, 1, DEFAULT_RECEIVE_TIMEOUT * 1000 ) > 0) { - if (recv( conn->socket, &buffer[recvd], 1, 0 ) <= 0) + int res; + if ((res = recv( conn->socket, &buffer[recvd], 1, 0 )) <= 0) { - set_last_error( sock_get_error( errno ) ); + if (res == -1) set_last_error( sock_get_error( errno ) ); break; } if (buffer[recvd] == '\n')