From 5ec513ec0ffc735e30c559a03378659ba4cc4515 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 23 Jan 2018 15:57:58 -0700 Subject: [PATCH] WSAEVENT is a pointer, so we cannot simply return the different of two events in io_compare(), which returns an int. This can return the wrong result for 64-bit executables. --- src/event.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/event.c b/src/event.c index 5edd3a6..84b18b3 100644 --- a/src/event.c +++ b/src/event.c @@ -41,7 +41,13 @@ static int io_compare(const io_t *a, const io_t *b) { #ifndef HAVE_MINGW return a->fd - b->fd; #else - return a->event - b->event; + if(a->event < b->event) { + return -1; + } + if(a->event > b->event) { + return 1; + } + return 0; #endif } -- 2.25.1