Pārlūkot izejas kodu

Fixed a broken loop. I must have forgotten that the loop variable was

unsigned when I wrote it :P
master
Richard Nyberg pirms 19 gadiem
vecāks
revīzija
3f8dd2ecd3
1 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. +4
    -4
      btpd/upload.c

+ 4
- 4
btpd/upload.c Parādīt failu

@@ -62,12 +62,12 @@ choke_do(void)
qsort(worthy, nworthy, sizeof(worthy[0]), rate_cmp); qsort(worthy, nworthy, sizeof(worthy[0]), rate_cmp);


bzero(unchoked, sizeof(unchoked)); bzero(unchoked, sizeof(unchoked));
for (i = nworthy - 1; i >= 0 && found < m_max_downloaders - 1; i--) {
if ((worthy[i].p->flags & PF_P_WANT) != 0)
for (i = nworthy; i > 0 && found < m_max_downloaders - 1; i--) {
if ((worthy[i - 1].p->flags & PF_P_WANT) != 0)
found++; found++;
if ((worthy[i].p->flags & PF_I_CHOKE) != 0)
if ((worthy[i - 1].p->flags & PF_I_CHOKE) != 0)
peer_unchoke(p); peer_unchoke(p);
unchoked[worthy[i].i] = 1;
unchoked[worthy[i - 1].i] = 1;
} }


i = 0; i = 0;


Notiek ielāde…
Atcelt
Saglabāt