From: Tor Lillqvist Date: Tue, 23 Sep 2008 15:35:12 +0000 (+0000) Subject: Fix embarrassing bug: I was passing an incorrect third parameter to X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=f911ead38229a065ba89bdf896fcfc7a53f74896;p=dana%2Fcg-glib.git Fix embarrassing bug: I was passing an incorrect third parameter to 2008-09-23 Tor Lillqvist * glib/gmain.c (poll_rest) [Win32]: Fix embarrassing bug: I was passing an incorrect third parameter to memmove(), had forgotten to multiply by the size of the table entry. Just use a for loop instead, clearer. Odd I didn't notice when testing this code. svn path=/trunk/; revision=7533 --- diff --git a/ChangeLog b/ChangeLog index 4c633104..c91132c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-09-23 Tor Lillqvist + + * glib/gmain.c (poll_rest) [Win32]: Fix embarrassing bug: I was + passing an incorrect third parameter to memmove(), had forgotten + to multiply by the size of the table entry. Just use a for loop + instead, clearer. Odd I didn't notice when testing this code. + 2008-09-22 Nelson Benítez León * gio/gioenums.h: Add new GFileCopyFlag, to leave target file with diff --git a/glib/gmain.c b/glib/gmain.c index fd216cf1..6b444bd0 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -447,8 +447,10 @@ poll_rest (gboolean poll_msgs, if (timeout == 0 && nhandles > 1) { /* Remove the handle that fired */ + int i; if (ready < nhandles - 1) - memmove (handles + ready - WAIT_OBJECT_0, handles + ready - WAIT_OBJECT_0 + 1, nhandles - ready - 1); + for (i = ready - WAIT_OBJECT_0 + 1; i < nhandles; i++) + handles[i-1] = handles[i]; nhandles--; recursed_result = poll_rest (FALSE, handles, nhandles, fds, nfds, 0); return (recursed_result == -1) ? -1 : 1 + recursed_result;