From f304504138c118cc5d2726d3b9805200c3e4a313 Mon Sep 17 00:00:00 2001 From: sin Date: Sat, 13 Sep 2014 15:50:45 +0100 Subject: Style fix --- ratatox.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ratatox.c b/ratatox.c index 69154a2..e4a5636 100644 --- a/ratatox.c +++ b/ratatox.c @@ -242,6 +242,7 @@ cb_status_message(Tox *m, int32_t fid, const uint8_t *data, uint16_t len, void * memcpy(status, data, len); status[len] = '\0'; + TAILQ_FOREACH(f, &friendhead, entry) { if (f->fid == fid) { snprintf(path, sizeof(path), "%s/status", f->idstr); @@ -496,6 +497,7 @@ loop(void) } } tox_do(tox); + FD_ZERO(&rfds); TAILQ_FOREACH(f, &friendhead, entry) { for (i = 0; i < NR_FIFOS; i++) { @@ -504,6 +506,7 @@ loop(void) FD_SET(f->fd[i], &rfds); } } + tv.tv_sec = 0; tv.tv_usec = tox_do_interval(tox) * 1000; n = select(fdmax + 1, &rfds, NULL, NULL, @@ -514,6 +517,7 @@ loop(void) perror("select"); exit(1); } + TAILQ_FOREACH(f, &friendhead, entry) { for (i = 0; i < NR_FIFOS; i++) { if (FD_ISSET(f->fd[i], &rfds) == 0) -- cgit v1.2.3