projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98e046a
)
fixing off-by-one
author
Christian Grothoff
<christian@grothoff.org>
Wed, 20 Oct 2010 08:01:20 +0000
(08:01 +0000)
committer
Christian Grothoff
<christian@grothoff.org>
Wed, 20 Oct 2010 08:01:20 +0000
(08:01 +0000)
src/util/network.c
patch
|
blob
|
history
diff --git
a/src/util/network.c
b/src/util/network.c
index cf74d43add439142e5ec259e10918aef285a786c..a1142d43341b80c0b99d7ef69494529a4431ede4 100644
(file)
--- a/
src/util/network.c
+++ b/
src/util/network.c
@@
-900,12
+900,16
@@
GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1,
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;