summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-12-09 09:39:16 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-12-09 09:39:16 +0000
commit73fa16fccbb85592973068a25949d4c331f7f475 (patch)
tree327a2f8d35d515c0998e89006e82c4c14df19b66
parent641d636fb24fb0dea567388a4f0d0f135d4ea48c (diff)
Add FD_ZERO() before usage of FD_SET()
-rw-r--r--src/sdp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sdp.c b/src/sdp.c
index 9f3f79e1e..90bc447e3 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;