[cvslog] (2005-11-26 23:41:13 UTC) Module eggdrop1.9: Change committed!

cvslog cvs at tsss.org
Sat Nov 26 17:41:13 CST 2005


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.9
Commit time: 2005-11-26 23:41:13 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     modules/server/dcc.c modules/server/nicklist.c

Log message:

dcc connect wasn't being triggered
nicklist memmove size wasn't right when removing elements from list

---------------------- diff included ----------------------
Index: eggdrop1.9/modules/server/dcc.c
diff -u eggdrop1.9/modules/server/dcc.c:1.22 eggdrop1.9/modules/server/dcc.c:1.23
--- eggdrop1.9/modules/server/dcc.c:1.22	Sat May  7 23:40:13 2005
+++ eggdrop1.9/modules/server/dcc.c	Sat Nov 26 17:41:03 2005
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: dcc.c,v 1.22 2005/05/08 04:40:13 stdarg Exp $";
+static const char rcsid[] = "$Id: dcc.c,v 1.23 2005/11/26 23:41:03 stdarg Exp $";
 #endif
 
 #include <unistd.h>
@@ -187,7 +187,7 @@
 
 	/* Give the waiting sockbuf the new socket and mark it as a client
 	 * so that it fires the on_connect event. */
-	sockbuf_set_sock(chat->client, sock, SOCKBUF_CLIENT);
+	sockbuf_set_sock(chat->client, sock, SOCKBUF_CONNECTING|SOCKBUF_CLIENT);
 
 	/* Delete the listening idx since it's not needed. */
 	chat->client = -1;
Index: eggdrop1.9/modules/server/nicklist.c
diff -u eggdrop1.9/modules/server/nicklist.c:1.10 eggdrop1.9/modules/server/nicklist.c:1.11
--- eggdrop1.9/modules/server/nicklist.c:1.10	Thu Jun 24 01:19:56 2004
+++ eggdrop1.9/modules/server/nicklist.c	Sat Nov 26 17:41:03 2005
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: nicklist.c,v 1.10 2004/06/24 06:19:56 wcc Exp $";
+static const char rcsid[] = "$Id: nicklist.c,v 1.11 2005/11/26 23:41:03 stdarg Exp $";
 #endif
 
 #include "server.h"
@@ -79,14 +79,12 @@
 /* Remove a nick from the nick list based on its index. */
 int nick_del(int num)
 {
-	if (num < 0 || num >= nick_list_len)
-		return(-1); /* Invalid nick index. */
+	if (num < 0 || num >= nick_list_len) return(-1); /* Invalid nick index. */
 
 	free(nick_list[num]);
-	memmove(nick_list + num, nick_list + num + 1, nick_list_len - num - 1);
+	memmove(nick_list + num, nick_list + num + 1, sizeof(*nick_list) * (nick_list_len - num - 1));
 	nick_list_len--;
-	if (num < nick_list_index)
-		nick_list_index--;
+	if (num < nick_list_index) nick_list_index--;
 
 	return(0);
 }
@@ -96,10 +94,8 @@
 {
 	int i;
 
-	for (i = 0; i < nick_list_len; i++)
-		free(nick_list[i]);
-	if (nick_list)
-		free(nick_list);
+	for (i = 0; i < nick_list_len; i++) free(nick_list[i]);
+	if (nick_list) free(nick_list);
 	nick_list = NULL;
 	nick_list_len = 0;
 
@@ -111,8 +107,8 @@
 {
 	int i;
 
-	for (i = 0; i < nick_list_len; i++)
-		if (!nick || !strcasecmp(nick_list[i], nick))
-			return(i);
+	for (i = 0; i < nick_list_len; i++) {
+		if (!nick || !strcasecmp(nick_list[i], nick)) return(i);
+	}
 	return(-1);
 }
----------------------- End of diff -----------------------



More information about the Changes mailing list