Sfoglia il codice sorgente

* Idx can potentialy be *0*, some places only checked >0 and not >=0

svn: 1444
Bryan Drewery 21 anni fa
parent
commit
058d3a8d4e
3 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 1 1
      src/mod/channels.mod/userchan.c
  2. 1 1
      src/mod/server.mod/servmsg.c
  3. 1 1
      src/net.c

+ 1 - 1
src/mod/channels.mod/userchan.c

@@ -989,7 +989,7 @@ bool write_chans(FILE *f, int idx)
     get_mode_protect(chan, w);
 
     /* if a bot should explicitly NOT join, just set it +inactive ... */
-    if (idx > 0 && !botshouldjoin(dcc[idx].user, chan))
+    if (idx >= 0 && !botshouldjoin(dcc[idx].user, chan))
       inactive = '+';
     /* ... otherwise give the bot the *actual* setting */
     else

+ 1 - 1
src/mod/server.mod/servmsg.c

@@ -310,7 +310,7 @@ static int got442(char *from, char *msg)
  */
 void nuke_server(char *reason)
 {
-  if (serv >= 0 && servidx > 0) {
+  if (serv >= 0 && servidx >= 0) {
     if (reason)
       dprintf(servidx, "QUIT :%s\n", reason);
 

+ 1 - 1
src/net.c

@@ -1670,7 +1670,7 @@ void dequeue_sockets()
       if (!socklist[i].outbuf) {
 	int idx = findanyidx(socklist[i].sock);
 
-	if (idx > 0 && dcc[idx].type && dcc[idx].type->outdone)
+	if (idx >= 0 && dcc[idx].type && dcc[idx].type->outdone)
 	  dcc[idx].type->outdone(idx);
       }
     }