From 73fa16fccbb85592973068a25949d4c331f7f475 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Dec 2005 09:39:16 +0000 Subject: Add FD_ZERO() before usage of FD_SET() --- src/sdp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sdp.c b/src/sdp.c index 9f3f79e1..90bc447e 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -1269,9 +1269,10 @@ int sdp_read_rsp(sdp_session_t *session, uint8_t *buf, uint32_t size) fd_set readFds; struct timeval timeout = { SDP_RESPONSE_TIMEOUT, 0 }; + FD_ZERO(&readFds); FD_SET(session->sock, &readFds); SDPDBG("Waiting for response\n"); - if (0 == select(session->sock + 1, &readFds, NULL, NULL, &timeout)) { + if (select(session->sock + 1, &readFds, NULL, NULL, &timeout) == 0) { SDPERR("Client timed out\n"); errno = ETIMEDOUT; return -1; -- cgit