[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r13307 - gnunet/src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r13307 - gnunet/src/util |
Date: |
Wed, 20 Oct 2010 10:01:20 +0200 |
Author: grothoff
Date: 2010-10-20 10:01:20 +0200 (Wed, 20 Oct 2010)
New Revision: 13307
Modified:
gnunet/src/util/network.c
Log:
fixing off-by-one
Modified: gnunet/src/util/network.c
===================================================================
--- gnunet/src/util/network.c 2010-10-19 21:16:50 UTC (rev 13306)
+++ gnunet/src/util/network.c 2010-10-20 08:01:20 UTC (rev 13307)
@@ -900,12 +900,16 @@
const struct GNUNET_NETWORK_FDSet *fds2)
{
int nfds;
+
nfds = fds1->nsds;
- if (nfds < fds2->nsds)
+ if (nfds > fds2->nsds)
nfds = fds2->nsds;
- for (; nfds >= 0; nfds--)
- if (FD_ISSET (nfds, &fds1->sds) && FD_ISSET (nfds, &fds2->sds))
- return GNUNET_YES;
+ while (nfds > 0)
+ {
+ nfds--;
+ if (FD_ISSET (nfds, &fds1->sds) && FD_ISSET (nfds, &fds2->sds))
+ return GNUNET_YES;
+ }
#ifdef MINGW
{
struct GNUNET_CONTAINER_SList_Iterator *it;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r13307 - gnunet/src/util,
gnunet <=