Signed-off-by: Yousong Zhou <yszhou4t...@gmail.com>
---
 uloop.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/uloop.c b/uloop.c
index 9a77ce4..3224f4b 100644
--- a/uloop.c
+++ b/uloop.c
@@ -394,11 +394,11 @@ int uloop_fd_delete(struct uloop_fd *fd)
 {
        int i;
 
-       for (i = 0; i < cur_nfds; i++) {
-               if (cur_fds[cur_fd + i].fd != fd)
+       for (i = cur_fd; i < cur_nfds; i++) {
+               if (cur_fds[i].fd != fd)
                        continue;
 
-               cur_fds[cur_fd + i].fd = NULL;
+               cur_fds[i].fd = NULL;
        }
 
        if (!fd->registered)
-- 
2.2.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to